~ubuntu-branches/ubuntu/vivid/gimp/vivid

« back to all changes in this revision

Viewing changes to plug-ins/gfig/gfig-style.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-08 18:50:03 UTC
  • mto: (1.1.26) (0.5.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: package-import@ubuntu.com-20120508185003-tltkvbaysf8d2426
ImportĀ upstreamĀ versionĀ 2.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 *
8
8
 * Copyright (C) 1997 Andy Thomas  alt@picnic.demon.co.uk
9
9
 *
10
 
 * This program is free software; you can redistribute it and/or modify
 
10
 * This program is free software: you can redistribute it and/or modify
11
11
 * it under the terms of the GNU General Public License as published by
12
 
 * the Free Software Foundation; either version 2 of the License, or
 
12
 * the Free Software Foundation; either version 3 of the License, or
13
13
 * (at your option) any later version.
14
14
 *
15
15
 * This program is distributed in the hope that it will be useful,
18
18
 * GNU General Public License for more details.
19
19
 *
20
20
 * You should have received a copy of the GNU General Public License
21
 
 * along with this program; if not, write to the Free Software
22
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
21
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
22
 *
24
23
 */
25
24
 
173
172
 
174
173
  style_entry->r = style_entry->g = style_entry->b = style_entry->a = 0.;
175
174
 
176
 
  snprintf (fmt_str, sizeof (fmt_str), "%%%lds %%%lds %%%lds %%%lds",
 
175
  snprintf (fmt_str, sizeof (fmt_str),
 
176
            "%%%" G_GSIZE_FORMAT "s"
 
177
            " %%%" G_GSIZE_FORMAT "s"
 
178
            " %%%" G_GSIZE_FORMAT "s"
 
179
            " %%%" G_GSIZE_FORMAT "s",
177
180
            sizeof (colorstr_r) - 1, sizeof (colorstr_g) - 1,
178
181
            sizeof (colorstr_b) - 1, sizeof (colorstr_a) - 1);
179
182
 
218
221
  offset = ftell (fp);
219
222
 
220
223
  get_line (load_buf2, MAX_LOAD_LINE, fp, 0);
221
 
  if (1 != sscanf (load_buf2, "<Style %99s>", name))
 
224
  /* nuke final > and preserve spaces in name */
 
225
  if (1 != sscanf (load_buf2, "<Style %99[^>]>", name))
222
226
    {
223
227
      /* no style data, copy default style and fail silently */
224
228
      gfig_style_copy (style, &gfig_context->default_style, "default style");
229
233
  if (gfig_context->debug_styles)
230
234
    g_printerr ("Loading style '%s' -- ", name);
231
235
 
232
 
  /* nuke final > in name */
233
 
  *strrchr (name, '>') = '\0';
234
 
 
235
236
  style->name = g_strdup (name);
236
237
 
237
238
  while (TRUE)