Skip to content

Commit 62eb83a

Browse files
committed
Use snprintf
1 parent 95cbcd9 commit 62eb83a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/_pyots/pyots-context.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ class PyOTSContext: public OTSContext {
4545
}
4646

4747
if (level == 0) {
48-
offset += sprintf(buff + offset, "ERROR: ");
48+
offset += snprintf(buff + offset, buffsize - offset, "ERROR: ");
4949
} else {
50-
offset += sprintf(buff + offset, "WARNING: ");
50+
offset += snprintf(buff + offset, buffsize - offset, "WARNING: ");
5151
}
5252

5353
va_start(va, format);
5454
offset += vsnprintf(buff + offset, buffsize - offset, format, va);
5555
va_end(va);
56-
offset += sprintf(buff + offset, "\n");
56+
offset += snprintf(buff + offset, buffsize - offset, "\n");
5757
}
5858

5959
TableAction GetTableAction(uint32_t tag) {

0 commit comments

Comments
 (0)