Kaydet (Commit) 88e138c8 authored tarafından Tim Peters's avatar Tim Peters

PyGrammar_LabelRepr(): sprintf -> PyOS_snprintf.

üst 1ca12961
...@@ -39,7 +39,7 @@ PyGrammar_LabelRepr(label *lb) ...@@ -39,7 +39,7 @@ PyGrammar_LabelRepr(label *lb)
return "EMPTY"; return "EMPTY";
else if (ISNONTERMINAL(lb->lb_type)) { else if (ISNONTERMINAL(lb->lb_type)) {
if (lb->lb_str == NULL) { if (lb->lb_str == NULL) {
sprintf(buf, "NT%d", lb->lb_type); PyOS_snprintf(buf, sizeof(buf), "NT%d", lb->lb_type);
return buf; return buf;
} }
else else
...@@ -49,7 +49,7 @@ PyGrammar_LabelRepr(label *lb) ...@@ -49,7 +49,7 @@ PyGrammar_LabelRepr(label *lb)
if (lb->lb_str == NULL) if (lb->lb_str == NULL)
return _PyParser_TokenNames[lb->lb_type]; return _PyParser_TokenNames[lb->lb_type];
else { else {
sprintf(buf, "%.32s(%.32s)", PyOS_snprintf(buf, sizeof(buf), "%.32s(%.32s)",
_PyParser_TokenNames[lb->lb_type], lb->lb_str); _PyParser_TokenNames[lb->lb_type], lb->lb_str);
return buf; return buf;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment