History of AFNI updates  

|
September 20, 2013 02:21PM
I had no grep syntax... as for original script the guy used -- it was using google services which are N/A any more: [web.mit.edu]

As for a quick grep line to catch some of the victims (not all since that would require syntax parsing and multiline handling) and not even care about snprintfs which might exhibit similar pattern, this might do it:

$> git grep -e 'sprintf(\s*\(\w\+\)\s*,[^,]\+,\s*\1\>'              
3dZcat.c:         sprintf(ZCAT_output_prefix, "%s.gz", ZCAT_output_prefix);
SUMA/SUMA_Surface_IO.c:                              sprintf(comment, "%s%c", comment, c);
SUMA/SUMA_niml.c:      for (i=0; i<3; ++i) sprintf(stmp,"%s %f", stmp, VolPar->CENTER_OLD);
SUMA/SUMA_niml.c:      for (i=0; i<3; ++i) sprintf(stmp,"%s %f", stmp, VolPar->CENTER_BASE);
SUMA/SUMA_niml.c:      for (i=0; i<12; ++i) sprintf(stmp,"%s %f", stmp, VolPar->MATVEC);
ccalc.c:            sprintf(expr,"%s %s", expr, argv[kar]);
ccalc.c:            sprintf(expr,"%s %s", expr, argv[kar]);
Subject Author Posted

undefined behavior of sprintf(buf, "%s", buf)

yarikoptic September 19, 2013 10:45PM

Re: undefined behavior of sprintf(buf, "%s", buf)

Bob Cox September 20, 2013 06:39AM

Re: undefined behavior of sprintf(buf, "%s", buf)

yarikoptic September 20, 2013 02:21PM

Re: undefined behavior of sprintf(buf, "%s", buf)

Bob Cox September 20, 2013 02:42PM

Re: undefined behavior of sprintf(buf, "%s", buf)

yarikoptic September 21, 2013 07:10PM

Re: undefined behavior of sprintf(buf, "%s", buf)

yarikoptic September 21, 2013 11:23AM