+2005-08-23 Tollef Fog Heen <tfheen@err.no>
+
+ * popthelp.c: char format[10] overflowed always with gcc4, so use
+ positional parameters instead. Thanks to Scott James Remnant for
+ pointing me to that solution. Debian #321961, Ubuntu #13950,
+ Freedesktop #2661
+
2005-08-22 Tollef Fog Heen <tfheen@err.no>
* check/check-cflags, check/check-define-variable,
const char * help = _(opt->descrip);
int helpLength;
const char * ch;
- char format[10];
char * left = alloca(maxLeftCol + 1);
const char * argDescrip = getArgDescrip(opt);
while (ch > (help + 1) && isspace(*ch)) ch--;
ch++;
- sprintf(format, "%%.%ds\n%%%ds", (int) (ch - help), indentLength);
- fprintf(f, format, help, " ");
+ fprintf(f, "%.*s\n%*s", (int) (ch - help), help, indentLength, " ");
+
help = ch;
while (isspace(*help) && *help) help++;
helpLength = strlen(help);