Commit 82bdbfed authored by michael's avatar michael

use sizeof in snprintf (note the changed code is all under #if 0)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11063 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 3fab9e32
...@@ -102,7 +102,7 @@ static void png_save2(const char *filename, uint32_t *bitmap, int w, int h) ...@@ -102,7 +102,7 @@ static void png_save2(const char *filename, uint32_t *bitmap, int w, int h)
char fname[40], fname2[40]; char fname[40], fname2[40];
char command[1024]; char command[1024];
snprintf(fname, 40, "%s.ppm", filename); snprintf(fname, sizeof(fname), "%s.ppm", filename);
f = fopen(fname, "w"); f = fopen(fname, "w");
if (!f) { if (!f) {
...@@ -124,7 +124,7 @@ static void png_save2(const char *filename, uint32_t *bitmap, int w, int h) ...@@ -124,7 +124,7 @@ static void png_save2(const char *filename, uint32_t *bitmap, int w, int h)
fclose(f); fclose(f);
snprintf(fname2, 40, "%s-a.pgm", filename); snprintf(fname2, sizeof(fname2), "%s-a.pgm", filename);
f = fopen(fname2, "w"); f = fopen(fname2, "w");
if (!f) { if (!f) {
...@@ -143,10 +143,10 @@ static void png_save2(const char *filename, uint32_t *bitmap, int w, int h) ...@@ -143,10 +143,10 @@ static void png_save2(const char *filename, uint32_t *bitmap, int w, int h)
} }
fclose(f); fclose(f);
snprintf(command, 1024, "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename); snprintf(command, sizeof(command), "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename);
system(command); system(command);
snprintf(command, 1024, "rm %s %s", fname, fname2); snprintf(command, sizeof(command), "rm %s %s", fname, fname2);
system(command); system(command);
} }
#endif #endif
...@@ -1262,7 +1262,7 @@ static void save_display_set(DVBSubContext *ctx) ...@@ -1262,7 +1262,7 @@ static void save_display_set(DVBSubContext *ctx)
} }
snprintf(filename, 32, "dvbs.%d", fileno_index); snprintf(filename, sizeof(filename), "dvbs.%d", fileno_index);
png_save2(filename, pbuf, width, height); png_save2(filename, pbuf, width, height);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment