mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-05-19 00:18:12 +02:00
Don't overflow format
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
This commit is contained in:
parent
53accfa62d
commit
cf48f83724
2 changed files with 9 additions and 3 deletions
|
|
@ -1,3 +1,10 @@
|
|||
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,
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ static void singleOptionHelp(FILE * f, int maxLeftCol,
|
|||
const char * help = _(opt->descrip);
|
||||
int helpLength;
|
||||
const char * ch;
|
||||
char format[10];
|
||||
char * left = alloca(maxLeftCol + 1);
|
||||
const char * argDescrip = getArgDescrip(opt);
|
||||
|
||||
|
|
@ -115,8 +114,8 @@ static void singleOptionHelp(FILE * f, int maxLeftCol,
|
|||
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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue