diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c index 17e031ea7e..ebe503251f 100644 --- a/app/display/gimpimagewindow.c +++ b/app/display/gimpimagewindow.c @@ -1146,7 +1146,11 @@ gimp_image_window_set_aux_info (GimpSessionManaged *session_managed, maximized = TRUE; if (width) +#ifndef _UCRT sscanf (aux->value, "%d", width); +#else + sscanf_s (aux->value, "%d", width); +#endif /* compat handling for right docks */ if (! strcmp (aux->name, GIMP_IMAGE_WINDOW_RIGHT_DOCKS_POS)) diff --git a/app/operations/gimpcurvesconfig.c b/app/operations/gimpcurvesconfig.c index d4953b071d..f7f419d05e 100644 --- a/app/operations/gimpcurvesconfig.c +++ b/app/operations/gimpcurvesconfig.c @@ -587,8 +587,13 @@ gimp_curves_config_load_cruft (GimpCurvesConfig *config, return FALSE; } +#ifndef _UCRT if (sscanf (x_str, "%d", &index[i][j]) != 1 || sscanf (y_str, "%d", &value[i][j]) != 1) +#else + if (sscanf_s (x_str, "%d", &index[i][j]) != 1 || + sscanf_s (y_str, "%d", &value[i][j]) != 1) +#endif { g_set_error_literal (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_PARSE, diff --git a/app/plug-in/gimppluginmanager-file.c b/app/plug-in/gimppluginmanager-file.c index f1188329fa..113f404dc1 100644 --- a/app/plug-in/gimppluginmanager-file.c +++ b/app/plug-in/gimppluginmanager-file.c @@ -588,7 +588,11 @@ file_convert_string (const gchar *instr, } *tmpptr = '\0'; +#ifndef _UCRT sscanf ((gchar *) tmp, "%o", &k); +#else + sscanf_s ((gchar *) tmp, "%o", &k); +#endif *(uout++) = k; break; @@ -626,7 +630,12 @@ file_check_single_magic (const gchar *offset, gchar num_operator; /* Check offset */ +#ifndef _UCRT if (sscanf (offset, "%ld", &offs) != 1) +#else + if (sscanf_s (offset, "%ld", &offs) != 1) +#endif + return FILE_MATCH_NONE; /* Check type of test */ @@ -667,11 +676,23 @@ file_check_single_magic (const gchar *offset, if (g_ascii_isdigit (num_operator_ptr[1])) { if (num_operator_ptr[1] != '0') /* decimal */ +#ifndef _UCRT sscanf (num_operator_ptr+1, "%lu", &num_operator_val); +#else + sscanf_s (num_operator_ptr+1, "%lu", &num_operator_val); +#endif else if (num_operator_ptr[2] == 'x') /* hexadecimal */ +#ifndef _UCRT sscanf (num_operator_ptr+3, "%lx", &num_operator_val); +#else + sscanf_s (num_operator_ptr+3, "%lx", &num_operator_val); +#endif else /* octal */ +#ifndef _UCRT sscanf (num_operator_ptr+2, "%lo", &num_operator_val); +#else + sscanf_s (num_operator_ptr+2, "%lo", &num_operator_val); +#endif num_operator = *num_operator_ptr; } diff --git a/app/widgets/gimpdashboard.c b/app/widgets/gimpdashboard.c index eeca8c8372..ac7965b2e5 100644 --- a/app/widgets/gimpdashboard.c +++ b/app/widgets/gimpdashboard.c @@ -2589,7 +2589,11 @@ gimp_dashboard_sample_memory_used (GimpDashboard *dashboard, buffer[size] = '\0'; +#ifndef _UCRT if (sscanf (buffer, "%*u %llu %llu", &resident, &shared) != 2) +#else + if (sscanf_s (buffer, "%*u %llu %llu", &resident, &shared) != 2) +#endif return; variable_data->available = TRUE; diff --git a/app/widgets/gimpselectiondata.c b/app/widgets/gimpselectiondata.c index dea192f2e6..c84e9b4142 100644 --- a/app/widgets/gimpselectiondata.c +++ b/app/widgets/gimpselectiondata.c @@ -588,8 +588,13 @@ gimp_selection_data_get_image (GtkSelectionData *selection, gint pid; gint ID; +#ifndef _UCRT if (sscanf (str, "%i:%i", &pid, &ID) == 2 && pid == gimp_get_pid ()) +#else + if (sscanf_s (str, "%i:%i", &pid, &ID) == 2 && + pid == gimp_get_pid ()) +#endif { return gimp_image_get_by_id (gimp, ID); } @@ -639,8 +644,13 @@ gimp_selection_data_get_component (GtkSelectionData *selection, gint ID; gint ch; +#ifndef _UCRT if (sscanf (str, "%i:%i:%i", &pid, &ID, &ch) == 3 && pid == gimp_get_pid ()) +#else + if (sscanf_s (str, "%i:%i:%i", &pid, &ID, &ch) == 3 && + pid == gimp_get_pid ()) +#endif { GimpImage *image = gimp_image_get_by_id (gimp, ID); @@ -688,8 +698,13 @@ gimp_selection_data_get_item (GtkSelectionData *selection, gint pid; gint ID; +#ifndef _UCRT if (sscanf (str, "%i:%i", &pid, &ID) == 2 && pid == gimp_get_pid ()) +#else + if (sscanf_s (str, "%i:%i", &pid, &ID) == 2 && + pid == gimp_get_pid ()) +#endif { return gimp_item_get_by_id (gimp, ID); } @@ -961,8 +976,13 @@ gimp_selection_data_get_object (GtkSelectionData *selection, gpointer object_addr; gint name_offset = 0; +#ifndef _UCRT if (sscanf (str, "%i:%p:%n", &pid, &object_addr, &name_offset) >= 2 && pid == gimp_get_pid () && name_offset > 0) +#else + if (sscanf_s (str, "%i:%p:%n", &pid, &object_addr, &name_offset) >= 2 && + pid == gimp_get_pid () && name_offset > 0) +#endif { const gchar *name = str + name_offset; diff --git a/app/widgets/gimptextbuffer.c b/app/widgets/gimptextbuffer.c index 06a66cbe4b..bfbeefe95b 100644 --- a/app/widgets/gimptextbuffer.c +++ b/app/widgets/gimptextbuffer.c @@ -1376,7 +1376,11 @@ gimp_text_buffer_name_to_tag (GimpTextBuffer *buffer, guint r, g, b; guchar rgb[3]; +#ifndef _UCRT sscanf (value, "#%02x%02x%02x", &r, &g, &b); +#else + sscanf_s (value, "#%02x%02x%02x", &r, &g, &b); +#endif rgb[0] = r; rgb[1] = g; rgb[2] = b; diff --git a/libgimp/gimpimagecombobox.c b/libgimp/gimpimagecombobox.c index 6e434cad7a..db189ac334 100644 --- a/libgimp/gimpimagecombobox.c +++ b/libgimp/gimpimagecombobox.c @@ -254,8 +254,13 @@ gimp_image_combo_box_drag_data_received (GtkWidget *widget, gint pid; gint ID; +#ifndef _UCRT if (sscanf (str, "%i:%i", &pid, &ID) == 2 && pid == gimp_getpid ()) +#else + if (sscanf_s (str, "%i:%i", &pid, &ID) == 2 && + pid == gimp_getpid ()) +#endif { gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (widget), ID); } diff --git a/libgimp/gimpitemcombobox.c b/libgimp/gimpitemcombobox.c index d5ccbbd1b1..fde010e0be 100644 --- a/libgimp/gimpitemcombobox.c +++ b/libgimp/gimpitemcombobox.c @@ -538,8 +538,13 @@ gimp_item_combo_box_drag_data_received (GtkWidget *widget, gint pid; gint ID; +#ifndef _UCRT if (sscanf (str, "%i:%i", &pid, &ID) == 2 && pid == gimp_getpid ()) +#else + if (sscanf_s (str, "%i:%i", &pid, &ID) == 2 && + pid == gimp_getpid ()) +#endif { gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (widget), ID); } diff --git a/libgimp/gimpresourcechooser.c b/libgimp/gimpresourcechooser.c index 6995515cff..774609963b 100644 --- a/libgimp/gimpresourcechooser.c +++ b/libgimp/gimpresourcechooser.c @@ -627,8 +627,13 @@ gimp_resource_select_drag_data_received (GimpResourceChooser *self, gpointer unused; gint name_offset = 0; +#ifndef _UCRT if (sscanf (str, "%i:%p:%n", &pid, &unused, &name_offset) >= 2 && pid == gimp_getpid () && name_offset > 0) +#else + if (sscanf_s (str, "%i:%p:%n", &pid, &unused, &name_offset) >= 2 && + pid == gimp_getpid () && name_offset > 0) +#endif { gchar *name = str + name_offset; GimpResource *resource; diff --git a/libgimpbase/gimpreloc.c b/libgimpbase/gimpreloc.c index 890196230b..2029f57552 100644 --- a/libgimpbase/gimpreloc.c +++ b/libgimpbase/gimpreloc.c @@ -297,12 +297,20 @@ _br_find_exe_for_symbol (const void *symbol, GimpBinrelocInitError *error) memcpy (address_string, "0x", 2); memcpy (address_string + 2, start_addr, len); address_string[2 + len] = '\0'; +#ifndef _UCRT sscanf (address_string, "%p", &start_addr_p); +#else + sscanf_s (address_string, "%p", &start_addr_p); +#endif memcpy (address_string, "0x", 2); memcpy (address_string + 2, end_addr, len); address_string[2 + len] = '\0'; +#ifndef _UCRT sscanf (address_string, "%p", &end_addr_p); +#else + sscanf_s (address_string, "%p", &end_addr_p); +#endif if (symbol >= start_addr_p && symbol < end_addr_p) { diff --git a/libgimpthumb/gimpthumbnail.c b/libgimpthumb/gimpthumbnail.c index 44b04bb655..98b0e72017 100644 --- a/libgimpthumb/gimpthumbnail.c +++ b/libgimpthumb/gimpthumbnail.c @@ -800,18 +800,30 @@ gimp_thumbnail_set_info_from_pixbuf (GimpThumbnail *thumbnail, g_strdup (gdk_pixbuf_get_option (pixbuf, TAG_THUMB_MIMETYPE)); option = gdk_pixbuf_get_option (pixbuf, TAG_THUMB_IMAGE_WIDTH); +#ifndef _UCRT if (option && sscanf (option, "%d", &num) == 1) +#else + if (option && sscanf_s (option, "%d", &num) == 1) +#endif thumbnail->image_width = num; option = gdk_pixbuf_get_option (pixbuf, TAG_THUMB_IMAGE_HEIGHT); +#ifndef _UCRT if (option && sscanf (option, "%d", &num) == 1) +#else + if (option && sscanf_s (option, "%d", &num) == 1) +#endif thumbnail->image_height = num; thumbnail->image_type = g_strdup (gdk_pixbuf_get_option (pixbuf, TAG_THUMB_GIMP_TYPE)); option = gdk_pixbuf_get_option (pixbuf, TAG_THUMB_GIMP_LAYERS); +#ifndef _UCRT if (option && sscanf (option, "%d", &num) == 1) +#else + if (option && sscanf_s (option, "%d", &num) == 1) +#endif thumbnail->image_num_layers = num; g_object_thaw_notify (G_OBJECT (thumbnail)); @@ -1066,11 +1078,19 @@ gimp_thumbnail_load_thumb (GimpThumbnail *thumbnail, state = GIMP_THUMB_STATE_OLD; option = gdk_pixbuf_get_option (pixbuf, TAG_THUMB_MTIME); +#ifndef _UCRT if (!option || sscanf (option, "%" G_GINT64_FORMAT, &image_mtime) != 1) +#else + if (!option || sscanf_s (option, "%" G_GINT64_FORMAT, &image_mtime) != 1) +#endif goto finish; option = gdk_pixbuf_get_option (pixbuf, TAG_THUMB_FILESIZE); +#ifndef _UCRT if (option && sscanf (option, "%" G_GINT64_FORMAT, &image_size) != 1) +#else + if (option && sscanf_s (option, "%" G_GINT64_FORMAT, &image_size) != 1) +#endif goto finish; /* TAG_THUMB_FILESIZE is optional but must match if present */ @@ -1424,11 +1444,19 @@ gimp_thumbnail_has_failed (GimpThumbnail *thumbnail) goto finish; option = gdk_pixbuf_get_option (pixbuf, TAG_THUMB_MTIME); +#ifndef _UCRT if (!option || sscanf (option, "%" G_GINT64_FORMAT, &image_mtime) != 1) +#else + if (!option || sscanf_s (option, "%" G_GINT64_FORMAT, &image_mtime) != 1) +#endif goto finish; option = gdk_pixbuf_get_option (pixbuf, TAG_THUMB_FILESIZE); +#ifndef _UCRT if (option && sscanf (option, "%" G_GINT64_FORMAT, &image_size) != 1) +#else + if (option && sscanf_s (option, "%" G_GINT64_FORMAT, &image_size) != 1) +#endif goto finish; /* TAG_THUMB_FILESIZE is optional but must match if present */ diff --git a/libgimpwidgets/gimppageselector.c b/libgimpwidgets/gimppageselector.c index bccfc1aa54..ee6935b0ad 100644 --- a/libgimpwidgets/gimppageselector.c +++ b/libgimpwidgets/gimppageselector.c @@ -894,10 +894,18 @@ gimp_page_selector_select_range (GimpPageSelector *selector, from = g_strstrip (range); to = g_strstrip (dash + 1); +#ifndef _UCRT if (sscanf (from, "%i", &page_from) != 1 && strlen (from) == 0) +#else + if (sscanf_s (from, "%i", &page_from) != 1 && strlen (from) == 0) +#endif page_from = 1; +#ifndef _UCRT if (sscanf (to, "%i", &page_to) != 1 && strlen (to) == 0) +#else + if (sscanf_s (to, "%i", &page_to) != 1 && strlen (to) == 0) +#endif page_to = selector->n_pages; if (page_from > 0 && @@ -918,9 +926,15 @@ gimp_page_selector_select_range (GimpPageSelector *selector, { gint page_no; +#ifndef _UCRT if (sscanf (range, "%i", &page_no) == 1 && page_no >= 1 && page_no <= selector->n_pages) +#else + if (sscanf_s (range, "%i", &page_no) == 1 && + page_no >= 1 && + page_no <= selector->n_pages) +#endif { gimp_page_selector_select_page (selector, page_no - 1); } diff --git a/plug-ins/common/curve-bend.c b/plug-ins/common/curve-bend.c index 82a83ed23f..d7f4f56a24 100644 --- a/plug-ins/common/curve-bend.c +++ b/plug-ins/common/curve-bend.c @@ -829,8 +829,13 @@ p_load_pointfile (BenderDialog *cd, if (strncmp (buff, KEY_POINTS, len) == 0) { +#ifndef _UCRT n = sscanf (&buff[len], "%f %f %f %f", &fux, &fuy, &flx, &fly); +#else + n = sscanf_s (&buff[len], + "%f %f %f %f", &fux, &fuy, &flx, &fly); +#endif if ((n == 4) && (pi < 17)) { @@ -850,7 +855,11 @@ p_load_pointfile (BenderDialog *cd, if (strncmp (buff, KEY_VAL_Y, len) == 0) { +#ifndef _UCRT n = sscanf (&buff[len], "%d %d", &iuy, &ily); +#else + n = sscanf_s (&buff[len], "%d %d", &iuy, &ily); +#endif if ((n == 2) && (ci < 256)) { diff --git a/plug-ins/common/file-gif-export.c b/plug-ins/common/file-gif-export.c index 53b0e5d0d1..aa619af836 100644 --- a/plug-ins/common/file-gif-export.c +++ b/plug-ins/common/file-gif-export.c @@ -309,7 +309,11 @@ gif_export (GimpProcedure *procedure, parasite_data = (gchar *) gimp_parasite_get_data (parasite, ¶site_size); parasite_data = g_strndup (parasite_data, parasite_size); +#ifndef _UCRT if (sscanf (parasite_data, "%i", &num_loops) == 1) +#else + if (sscanf_s (parasite_data, "%i", &num_loops) == 1) +#endif { gboolean loop = (num_loops == 0); diff --git a/plug-ins/common/file-ps.c b/plug-ins/common/file-ps.c index ff725945bd..0db0a72359 100644 --- a/plug-ins/common/file-ps.c +++ b/plug-ins/common/file-ps.c @@ -1192,7 +1192,11 @@ load_image (GFile *file, { if ((*temp < '0') || (*temp > '9')) continue; /* Search next digit */ +#ifndef _UCRT sscanf (temp, "%d", &k); +#else + sscanf_s (temp, "%d", &k); +#endif if (k > max_pagenum) max_pagenum = k; while ((*temp >= '0') && (*temp <= '9')) @@ -1814,7 +1818,11 @@ get_bbox (GFile *file, src += 11; while ((*src == ' ') || (*src == '\t') || (*src == ':')) src++; if (strncmp (src, "(atend)", 7) == 0) continue; +#ifndef _UCRT if (sscanf (src, "%d%d%d%d", x0, y0, x1, y1) == 4) +#else + if (sscanf_s (src, "%d%d%d%d", x0, y0, x1, y1) == 4) +#endif retval = 0; break; } @@ -2162,7 +2170,11 @@ read_pnmraw_type (FILE *ifp, if (line[0] != '#') break; } +#ifndef _UCRT if (sscanf (line, "%d%d", width, height) != 2) +#else + if (sscanf_s (line, "%d%d", width, height) != 2) +#endif return -1; *maxval = 255; @@ -2176,7 +2188,11 @@ read_pnmraw_type (FILE *ifp, if (line[0] != '#') break; } +#ifndef _UCRT if (sscanf (line, "%d", maxval) != 1) +#else + if (sscanf_s (line, "%d", maxval) != 1) +#endif return -1; } @@ -3745,7 +3761,12 @@ count_ps_pages (GFile *file) fgets (buf, sizeof (buf), psfile); if (strncmp (buf + 2, "Pages:", 6) == 0) +#ifndef _UCRT sscanf (buf + strlen ("%%Pages:"), "%d", &num_pages); +#else + sscanf_s (buf + strlen ("%%Pages:"), "%d", &num_pages); +#endif + else if (strncmp (buf, "showpage", 8) == 0) showpage_count++; } diff --git a/plug-ins/common/file-xbm.c b/plug-ins/common/file-xbm.c index 3c09e6d86a..d3a38a9fd3 100644 --- a/plug-ins/common/file-xbm.c +++ b/plug-ins/common/file-xbm.c @@ -382,7 +382,11 @@ xbm_export (GimpProcedure *procedure, parasite_data = (gchar *) gimp_parasite_get_data (parasite, ¶site_size); parasite_data = g_strndup (parasite_data, parasite_size); +#ifndef _UCRT if (sscanf (parasite_data, "%i %i", &x, &y) == 2) +#else + if (sscanf_s (parasite_data, "%i %i", &x, &y) == 2) +#endif { g_object_set (config, "use-hot-spot", TRUE, diff --git a/plug-ins/common/sample-colorize.c b/plug-ins/common/sample-colorize.c index 658a13feba..2fd78d3aff 100644 --- a/plug-ins/common/sample-colorize.c +++ b/plug-ins/common/sample-colorize.c @@ -1888,7 +1888,11 @@ get_filevalues (void) if (fp != NULL) { fgets (buf, 999, fp); +#ifndef _UCRT sscanf (buf, "%f", &g_values.tol_col_err); +#else + sscanf_s (buf, "%f", &g_values.tol_col_err); +#endif fclose (fp); } diff --git a/plug-ins/common/sphere-designer.c b/plug-ins/common/sphere-designer.c index a62bec9e8d..a54a25a81a 100644 --- a/plug-ins/common/sphere-designer.c +++ b/plug-ins/common/sphere-designer.c @@ -2115,7 +2115,11 @@ loadit (const gchar * fn) t = &s.com.texture[i]; setdefaults (t); +#ifndef _UCRT if (sscanf (line, fmt_str, &t->majtype, &t->type, end) != 3) +#else + if (sscanf_s (line, fmt_str, &t->majtype, &t->type, end) != 3) +#endif t->color1.x = g_ascii_strtod (end, &end); if (end && errno != ERANGE) t->color1.y = g_ascii_strtod (end, &end); diff --git a/plug-ins/file-dds/ddswrite.c b/plug-ins/file-dds/ddswrite.c index 15496c6783..0c9a9163ea 100644 --- a/plug-ins/file-dds/ddswrite.c +++ b/plug-ins/file-dds/ddswrite.c @@ -534,9 +534,15 @@ write_dds (GFile *file, ¶site_size); parasite_data = g_strndup (parasite_data, parasite_size); +#ifndef _UCRT n_params = sscanf (parasite_data, "%d %d %d %d %d %d", &version, &comp_format, &d3d9_format, &dxgi_format, &flags, &n_mipmaps); +#else + n_params = sscanf_s (parasite_data, "%d %d %d %d %d %d", &version, + &comp_format, &d3d9_format, &dxgi_format, &flags, + &n_mipmaps); +#endif if (n_params == 6) { const gchar *config_comp_format; diff --git a/plug-ins/file-ico/ico-export.c b/plug-ins/file-ico/ico-export.c index 5a0f136a5f..3be9ae5f66 100644 --- a/plug-ins/file-ico/ico-export.c +++ b/plug-ins/file-ico/ico-export.c @@ -345,7 +345,11 @@ ico_save_dialog (GimpImage *image, parasite_data = (gchar *) gimp_parasite_get_data (parasite, ¶site_size); parasite_data = g_strndup (parasite_data, parasite_size); +#ifndef _UCRT if (sscanf (parasite_data, "%i %i", &x, &y) == 2) +#else + if (sscanf_s (parasite_data, "%i %i", &x, &y) == 2) +#endif { info->hot_spot_x[i] = x; info->hot_spot_y[i] = y; @@ -1308,7 +1312,11 @@ ani_export_image (GFile *file, parasite_data = (gchar *) gimp_parasite_get_data (parasite, ¶site_size); parasite_data = g_strndup (parasite_data, parasite_size); +#ifndef _UCRT if (sscanf (parasite_data, "%i", &jif_rate) == 1) +#else + if (sscanf_s (parasite_data, "%i", &jif_rate) == 1) +#endif { header->jif_rate = jif_rate; } diff --git a/plug-ins/file-raw/file-another-rawtherapee.c b/plug-ins/file-raw/file-another-rawtherapee.c index 4fa1a406e7..9e671fb05e 100644 --- a/plug-ins/file-raw/file-another-rawtherapee.c +++ b/plug-ins/file-raw/file-another-rawtherapee.c @@ -138,10 +138,17 @@ anotherrawtherapee_init_procedures (GimpPlugIn *plug_in) gint rtmajor = 0; gint rtminor = 0; +#ifndef _UCRT if (sscanf (art_stdout, "ART, version %d.%d", &rtmajor, &rtminor) == 2 && ((rtmajor == 1 && rtminor >= 20) || rtmajor >= 2)) +#else + if (sscanf_s (art_stdout, + "ART, version %d.%d", + &rtmajor, &rtminor) == 2 && + ((rtmajor == 1 && rtminor >= 20) || rtmajor >= 2)) +#endif { have_art = TRUE; } diff --git a/plug-ins/file-raw/file-darktable.c b/plug-ins/file-raw/file-darktable.c index f585e9c9b6..35067db4c1 100644 --- a/plug-ins/file-raw/file-darktable.c +++ b/plug-ins/file-raw/file-darktable.c @@ -654,7 +654,11 @@ load_thumbnail_image (GFile *file, darktable_file = g_file_new_for_path (response[i + 1]); image = gimp_file_load (GIMP_RUN_NONINTERACTIVE, darktable_file); +#ifndef _UCRT sscanf (response[i + 2], "%d %d", width, height); +#else + sscanf_s (response[i + 2], "%d %d", width, height); +#endif g_object_unref (darktable_file); break; @@ -690,7 +694,11 @@ load_thumbnail_image (GFile *file, -1, "[dt4gimp]"); if (start_of_size) +#ifndef _UCRT sscanf (start_of_size, "[dt4gimp] %d %d", width, height); +#else + sscanf_s (start_of_size, "[dt4gimp] %d %d", width, height); +#endif } } } diff --git a/plug-ins/file-raw/file-rawtherapee.c b/plug-ins/file-raw/file-rawtherapee.c index 0110f20197..27b265c325 100644 --- a/plug-ins/file-raw/file-rawtherapee.c +++ b/plug-ins/file-raw/file-rawtherapee.c @@ -138,10 +138,17 @@ rawtherapee_init_procedures (GimpPlugIn *plug_in) gint rtmajor = 0; gint rtminor = 0; +#ifndef _UCRT if (sscanf (rawtherapee_stdout, "RawTherapee, version %d.%d", &rtmajor, &rtminor) == 2 && ((rtmajor == 5 && rtminor >= 2) || rtmajor >= 6)) +#else + if (sscanf_s (rawtherapee_stdout, + "RawTherapee, version %d.%d", + &rtmajor, &rtminor) == 2 && + ((rtmajor == 5 && rtminor >= 2) || rtmajor >= 6)) +#endif { have_rawtherapee = TRUE; } diff --git a/plug-ins/gfig/gfig-dobject.c b/plug-ins/gfig/gfig-dobject.c index c317888fe8..4a00226c27 100644 --- a/plug-ins/gfig/gfig-dobject.c +++ b/plug-ins/gfig/gfig-dobject.c @@ -120,7 +120,11 @@ d_load_object (gchar *desc, while (get_line (buf, MAX_LOAD_LINE, fp, 0)) { +#ifndef _UCRT if (sscanf (buf, "%d %d", &xpnt, &ypnt) != 2) +#else + if (sscanf_s (buf, "%d %d", &xpnt, &ypnt) != 2) +#endif { /* Read block if there is one */ if (!strcmp ("", buf)) @@ -133,7 +137,11 @@ d_load_object (gchar *desc, get_line (buf, MAX_LOAD_LINE, fp, 0); +#ifndef _UCRT if (sscanf (buf, "%d", &new_obj->type_data) != 1) +#else + if (sscanf_s (buf, "%d", &new_obj->type_data) != 1) +#endif { g_message ("Error while loading object (no type data)"); g_free (new_obj); diff --git a/plug-ins/gfig/gfig.c b/plug-ins/gfig/gfig.c index 526b1cb506..be4a982557 100644 --- a/plug-ins/gfig/gfig.c +++ b/plug-ins/gfig/gfig.c @@ -386,7 +386,11 @@ gfig_name_decode (gchar *dest, { if (*src == '\\' && *(src+1) && *(src+2) && *(src+3)) { +#ifndef _UCRT sscanf (src+1, "%3o", &tmp); +#else + sscanf_s (src+1, "%3o", &tmp); +#endif *dest++ = tmp; src += 4; } @@ -562,7 +566,11 @@ gfig_load (GimpGfig *gfig, gfig_obj->version = g_ascii_strtod (load_buf + 9, NULL); get_line (load_buf, MAX_LOAD_LINE, fp, 0); +#ifndef _UCRT sscanf (load_buf, "ObjCount: %d", &load_count); +#else + sscanf_s (load_buf, "ObjCount: %d", &load_count); +#endif if (load_options (gfig_obj, fp)) { diff --git a/plug-ins/gradient-flare/gradient-flare.c b/plug-ins/gradient-flare/gradient-flare.c index e271c51f3a..ce5c2c8d61 100644 --- a/plug-ins/gradient-flare/gradient-flare.c +++ b/plug-ins/gradient-flare/gradient-flare.c @@ -4789,7 +4789,11 @@ gradient_name_decode (gchar *dest, { if (*src == '\\' && *(src+1) && *(src+2) && *(src+3)) { +#ifndef _UCRT sscanf (src+1, "%3o", &tmp); +#else + sscanf_s (src+1, "%3o", &tmp); +#endif *dest++ = tmp; src += 4; } diff --git a/plug-ins/metadata/metadata-editor.c b/plug-ins/metadata/metadata-editor.c index ebbb52e331..0db6eda909 100644 --- a/plug-ins/metadata/metadata-editor.c +++ b/plug-ins/metadata/metadata-editor.c @@ -1673,7 +1673,11 @@ on_date_button_clicked (GtkButton *widget, date_text = gtk_entry_get_text (GTK_ENTRY (entry_widget)); if (date_text && date_text[0] != '\0') { +#ifndef _UCRT sscanf (date_text, "%u-%u-%u;", &year, &month, &day); +#else + sscanf_s (date_text, "%u-%u-%u;", &year, &month, &day); +#endif month--; } else diff --git a/plug-ins/script-fu/libscriptfu/tinyscheme/scheme.c b/plug-ins/script-fu/libscriptfu/tinyscheme/scheme.c index de26ac398d..b5046fd40f 100644 --- a/plug-ins/script-fu/libscriptfu/tinyscheme/scheme.c +++ b/plug-ins/script-fu/libscriptfu/tinyscheme/scheme.c @@ -1338,14 +1338,26 @@ static pointer mk_sharp_const(scheme *sc, char *name) { return (sc->F); else if (*name == 'o') {/* #o (octal) */ snprintf(tmp, STRBUFFSIZE, "0%s", name+1); +#ifndef _UCRT sscanf(tmp, "%lo", (long unsigned *)&x); +#else + sscanf_s(tmp, "%lo", (long unsigned *)&x); +#endif return (mk_integer(sc, x)); } else if (*name == 'd') { /* #d (decimal) */ +#ifndef _UCRT sscanf(name+1, "%ld", (long int *)&x); +#else + sscanf_s(name+1, "%ld", (long int *)&x); +#endif return (mk_integer(sc, x)); } else if (*name == 'x') { /* #x (hex) */ snprintf(tmp, STRBUFFSIZE, "0x%s", name+1); +#ifndef _UCRT sscanf(tmp, "%lx", (long unsigned *)&x); +#else + sscanf_s(tmp, "%lx", (long unsigned *)&x); +#endif return (mk_integer(sc, x)); } else if (*name == 'b') { /* #b (binary) */ x = binary_decode(name+1); @@ -1371,7 +1383,11 @@ static pointer mk_sharp_const(scheme *sc, char *name) { } else { /* #\x<[0-f]*> Convert hex literal to codepoint. */ +#ifndef _UCRT if(sscanf(name+2,"%x",(unsigned int *)&codepoint)!=1) { +#else + if(sscanf_s(name+2,"%x",(unsigned int *)&codepoint)!=1) { +#endif g_warning ("Hex literal has invalid digits"); return sc->NIL; }