As we open the ppm file in binary mode, we shouldn't assume that the
* app/about_dialog.c (about_dialog_load_logo): As we open the ppm file in binary mode, we shouldn't assume that the header lines read with fgets end with just a '\n'.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
1999-06-03 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* app/about_dialog.c (about_dialog_load_logo): As we open the ppm
|
||||||
|
file in binary mode, we shouldn't assume that the header lines
|
||||||
|
read with fgets end with just a '\n'.
|
||||||
|
|
||||||
1999-06-02 Seth Burgess <sjburges@gimp.org>
|
1999-06-02 Seth Burgess <sjburges@gimp.org>
|
||||||
|
|
||||||
* app/Makefile.am : Added new Files, indicator_area.[ch]
|
* app/Makefile.am : Added new Files, indicator_area.[ch]
|
||||||
|
@ -302,7 +302,8 @@ about_dialog_load_logo (GtkWidget *window)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fgets (buf, 1024, fp);
|
fgets (buf, 1024, fp);
|
||||||
if (strcmp (buf, "P6\n") != 0)
|
|
||||||
|
if (strncmp (buf, "P6", 2) != 0)
|
||||||
{
|
{
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
return 0;
|
return 0;
|
||||||
@ -313,7 +314,7 @@ about_dialog_load_logo (GtkWidget *window)
|
|||||||
sscanf (buf, "%d %d", &logo_width, &logo_height);
|
sscanf (buf, "%d %d", &logo_width, &logo_height);
|
||||||
|
|
||||||
fgets (buf, 1024, fp);
|
fgets (buf, 1024, fp);
|
||||||
if (strcmp (buf, "255\n") != 0)
|
if (strncmp (buf, "255", 3) != 0)
|
||||||
{
|
{
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -302,7 +302,8 @@ about_dialog_load_logo (GtkWidget *window)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fgets (buf, 1024, fp);
|
fgets (buf, 1024, fp);
|
||||||
if (strcmp (buf, "P6\n") != 0)
|
|
||||||
|
if (strncmp (buf, "P6", 2) != 0)
|
||||||
{
|
{
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
return 0;
|
return 0;
|
||||||
@ -313,7 +314,7 @@ about_dialog_load_logo (GtkWidget *window)
|
|||||||
sscanf (buf, "%d %d", &logo_width, &logo_height);
|
sscanf (buf, "%d %d", &logo_width, &logo_height);
|
||||||
|
|
||||||
fgets (buf, 1024, fp);
|
fgets (buf, 1024, fp);
|
||||||
if (strcmp (buf, "255\n") != 0)
|
if (strncmp (buf, "255", 3) != 0)
|
||||||
{
|
{
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -302,7 +302,8 @@ about_dialog_load_logo (GtkWidget *window)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fgets (buf, 1024, fp);
|
fgets (buf, 1024, fp);
|
||||||
if (strcmp (buf, "P6\n") != 0)
|
|
||||||
|
if (strncmp (buf, "P6", 2) != 0)
|
||||||
{
|
{
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
return 0;
|
return 0;
|
||||||
@ -313,7 +314,7 @@ about_dialog_load_logo (GtkWidget *window)
|
|||||||
sscanf (buf, "%d %d", &logo_width, &logo_height);
|
sscanf (buf, "%d %d", &logo_width, &logo_height);
|
||||||
|
|
||||||
fgets (buf, 1024, fp);
|
fgets (buf, 1024, fp);
|
||||||
if (strcmp (buf, "255\n") != 0)
|
if (strncmp (buf, "255", 3) != 0)
|
||||||
{
|
{
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user