WLoncke / simuino

Automatically exported from code.google.com/p/simuino
0 stars 0 forks source link

Dicey sprintf() #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

In function openCommand() of simuino.c there is a sprintf() statement that is 
not portable and can likely fail on most platforms.  At approximately line 538, 
the code attempts to report an error if the sketch the user has specified is 
not found.  The problem is that the same string buffer is used for both an 
argument and the destination of the sprintf().  The line is:

    sprintf(temp,"Sketch not found: %s",temp);

An alternative call that should work on all platforms is:

    sprintf(temp,"Sketch not found: %s",command[2]);

Original issue reported on code.google.com by smor...@gmail.com on 8 Feb 2012 at 6:49

GoogleCodeExporter commented 8 years ago

Original comment by benny.sa...@gmail.com on 9 Feb 2012 at 10:04

GoogleCodeExporter commented 8 years ago

Original comment by benny.sa...@gmail.com on 9 Feb 2012 at 5:04

GoogleCodeExporter commented 8 years ago
Fixed in next version

Original comment by benny.sa...@gmail.com on 9 Feb 2012 at 5:06

GoogleCodeExporter commented 8 years ago
Fixed in version 0.1.7

Original comment by benny.sa...@gmail.com on 17 Feb 2012 at 4:32