You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gpdf.c: In function ‘draw_pdf’:
gpdf.c:1348:19: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 4 and 13 [-Wformat-overflow=]
1348 | sprintf(s, "%d, %d", j, i);
| ^~
gpdf.c:1348:14: note: directive argument in the range [0, 2147483647]
1348 | sprintf(s, "%d, %d", j, i);
| ^~~~~~~~
gpdf.c:1348:3: note: ‘sprintf’ output between 5 and 23 bytes into a destination of size 16
1348 | sprintf(s, "%d, %d", j, i);
The text was updated successfully, but these errors were encountered:
I wrote this in 2016 and haven't touched it since. Gcc has obviously become more pernickety since. That particular line is outputting dimensions in points on a piece of paper which can't be bigger than A0 because, AFAIK, you can't get printers/plotters bigger than that. So it won't overflow the buffer char s[16];. You could make it bigger to make the warning go away or suppress the warning.
gpdf.c: In function ‘draw_pdf’:
gpdf.c:1348:19: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 4 and 13 [-Wformat-overflow=]
1348 | sprintf(s, "%d, %d", j, i);
| ^~
gpdf.c:1348:14: note: directive argument in the range [0, 2147483647]
1348 | sprintf(s, "%d, %d", j, i);
| ^~~~~~~~
gpdf.c:1348:3: note: ‘sprintf’ output between 5 and 23 bytes into a destination of size 16
1348 | sprintf(s, "%d, %d", j, i);
The text was updated successfully, but these errors were encountered: