Changeset b9cb41b for global.c


Ignore:
Timestamp:
Dec 6, 2008, 11:25:33 PM (12 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
56d0189
Parents:
49a8434
git-author:
Anders Kaseorg <andersk@mit.edu> (12/06/08 23:20:19)
git-committer:
Anders Kaseorg <andersk@mit.edu> (12/06/08 23:25:33)
Message:
Replace questionable sprintf(buf, "%s...", buf, ...) pattern, which is
broken by -D_FORTIFY_SOURCE.

perl -pe 's/(sprintf\s*\(\s*([^,]*))(\s*,\s*")%s([^"]*"\s*,)\s*\2\s*,/\1 + strlen(\2)\3\4/g'
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    rb7bb454 rb9cb41b  
    568568  strcpy(g->startupargs, "");
    569569  for (i=0; i<argc; i++) {
    570     sprintf(g->startupargs, "%s%s ", g->startupargs, argv[i]);
     570    sprintf(g->startupargs + strlen(g->startupargs), "%s ", argv[i]);
    571571  }
    572572  g->startupargs[strlen(g->startupargs)-1]='\0';
Note: See TracChangeset for help on using the changeset viewer.