examples: Use snprintf() instead of sprintf() in dpfp and dpfp_threaded

The OpenBSD C compiler generates a warning for every use of sprintf()
and for a good reason. Reported in http://marc.info/?m=133376187514495

Reported-by: Xiaofan Chen <xiaofanc@gmail.com>
This commit is contained in:
Peter Stuge
2012-04-07 05:20:36 +02:00
committed by Pete Batard
parent 5b7d1c57f8
commit d346cd9060
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -226,7 +226,7 @@ static int save_to_file(unsigned char *data)
FILE *fd;
char filename[64];
sprintf(filename, "finger%d.pgm", img_idx++);
snprintf(filename, sizeof(filename), "finger%d.pgm", img_idx++);
fd = fopen(filename, "w");
if (!fd)
return -1;
+1 -1
View File
@@ -255,7 +255,7 @@ static int save_to_file(unsigned char *data)
FILE *fd;
char filename[64];
sprintf(filename, "finger%d.pgm", img_idx++);
snprintf(filename, sizeof(filename), "finger%d.pgm", img_idx++);
fd = fopen(filename, "w");
if (!fd)
return -1;