mirror of https://github.com/GNOME/gimp.git
double the length of the cursor_format_str as users may define strange
1999-03-16 Michael Natterer <mitschel@cs.tu-berlin.de> * app/gdisplay.h: double the length of the cursor_format_str as users may define strange units now * app/xcf.c: forgot a sanity check when loading/saving the user unit property
This commit is contained in:
parent
5e8ee554a2
commit
9e0b4e91db
|
@ -1,3 +1,11 @@
|
|||
1999-03-16 Michael Natterer <mitschel@cs.tu-berlin.de>
|
||||
|
||||
* app/gdisplay.h: double the length of the cursor_format_str as
|
||||
users may define strange units now
|
||||
|
||||
* app/xcf.c: forgot a sanity check when loading/saving the user
|
||||
unit property
|
||||
|
||||
1999-03-16 Michael Natterer <mitschel@cs.tu-berlin.de>
|
||||
|
||||
This implements the rest of the unit system (unitrc loading and
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
#define CURSOR_STR_LENGTH 256
|
||||
|
||||
/* maximal length of the format string for the cursor-coordinates */
|
||||
#define CURSOR_FORMAT_LENGTH 16
|
||||
#define CURSOR_FORMAT_LENGTH 32
|
||||
|
||||
typedef struct _IdleRenderStruct
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
#define CURSOR_STR_LENGTH 256
|
||||
|
||||
/* maximal length of the format string for the cursor-coordinates */
|
||||
#define CURSOR_FORMAT_LENGTH 16
|
||||
#define CURSOR_FORMAT_LENGTH 32
|
||||
|
||||
typedef struct _IdleRenderStruct
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
#define CURSOR_STR_LENGTH 256
|
||||
|
||||
/* maximal length of the format string for the cursor-coordinates */
|
||||
#define CURSOR_FORMAT_LENGTH 16
|
||||
#define CURSOR_FORMAT_LENGTH 32
|
||||
|
||||
typedef struct _IdleRenderStruct
|
||||
{
|
||||
|
|
14
app/xcf.c
14
app/xcf.c
|
@ -1175,11 +1175,11 @@ xcf_save_prop (XcfInfo *info,
|
|||
|
||||
size =
|
||||
2 * 4 +
|
||||
strlen (unit_strings[0]) + 5 +
|
||||
strlen (unit_strings[1]) + 5 +
|
||||
strlen (unit_strings[2]) + 5 +
|
||||
strlen (unit_strings[3]) + 5 +
|
||||
strlen (unit_strings[4]) + 5;
|
||||
strlen (unit_strings[0]) ? strlen (unit_strings[0]) + 5 : 4 +
|
||||
strlen (unit_strings[1]) ? strlen (unit_strings[1]) + 5 : 4 +
|
||||
strlen (unit_strings[2]) ? strlen (unit_strings[2]) + 5 : 4 +
|
||||
strlen (unit_strings[3]) ? strlen (unit_strings[3]) + 5 : 4 +
|
||||
strlen (unit_strings[4]) ? strlen (unit_strings[4]) + 5 : 4;
|
||||
|
||||
info->cp += xcf_write_int32 (info->fp, (guint32*) &prop_type, 1);
|
||||
info->cp += xcf_write_int32 (info->fp, &size, 1);
|
||||
|
@ -1849,6 +1849,10 @@ xcf_load_image_props (XcfInfo *info,
|
|||
info->cp += xcf_read_int32 (info->fp, &digits, 1);
|
||||
info->cp += xcf_read_string (info->fp, unit_strings, 5);
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
if (unit_strings[i] == NULL)
|
||||
unit_strings[i] = g_strdup ("");
|
||||
|
||||
num_units = gimp_unit_get_number_of_units ();
|
||||
|
||||
for (unit = gimp_unit_get_number_of_built_in_units ();
|
||||
|
|
|
@ -1175,11 +1175,11 @@ xcf_save_prop (XcfInfo *info,
|
|||
|
||||
size =
|
||||
2 * 4 +
|
||||
strlen (unit_strings[0]) + 5 +
|
||||
strlen (unit_strings[1]) + 5 +
|
||||
strlen (unit_strings[2]) + 5 +
|
||||
strlen (unit_strings[3]) + 5 +
|
||||
strlen (unit_strings[4]) + 5;
|
||||
strlen (unit_strings[0]) ? strlen (unit_strings[0]) + 5 : 4 +
|
||||
strlen (unit_strings[1]) ? strlen (unit_strings[1]) + 5 : 4 +
|
||||
strlen (unit_strings[2]) ? strlen (unit_strings[2]) + 5 : 4 +
|
||||
strlen (unit_strings[3]) ? strlen (unit_strings[3]) + 5 : 4 +
|
||||
strlen (unit_strings[4]) ? strlen (unit_strings[4]) + 5 : 4;
|
||||
|
||||
info->cp += xcf_write_int32 (info->fp, (guint32*) &prop_type, 1);
|
||||
info->cp += xcf_write_int32 (info->fp, &size, 1);
|
||||
|
@ -1849,6 +1849,10 @@ xcf_load_image_props (XcfInfo *info,
|
|||
info->cp += xcf_read_int32 (info->fp, &digits, 1);
|
||||
info->cp += xcf_read_string (info->fp, unit_strings, 5);
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
if (unit_strings[i] == NULL)
|
||||
unit_strings[i] = g_strdup ("");
|
||||
|
||||
num_units = gimp_unit_get_number_of_units ();
|
||||
|
||||
for (unit = gimp_unit_get_number_of_built_in_units ();
|
||||
|
|
Loading…
Reference in New Issue