diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c index 8fce29d5b3..f2a1f767d3 100644 --- a/app/display/gimpstatusbar.c +++ b/app/display/gimpstatusbar.c @@ -1944,7 +1944,13 @@ gimp_statusbar_shell_scaled (GimpDisplayShell *shell, sizeof (statusbar->cursor_format_str), "%%s%%.%df%%s%%.%df%%s", w_digits, h_digits); +#ifndef _UCRT strcpy (statusbar->cursor_format_str_f, statusbar->cursor_format_str); +#else + strcpy_s (statusbar->cursor_format_str_f, + sizeof (statusbar->cursor_format_str_f), + statusbar->cursor_format_str); +#endif g_snprintf (statusbar->length_format_str, sizeof (statusbar->length_format_str), "%%s%%.%df%%s", MAX (w_digits, h_digits)); diff --git a/app/text/gimptext-xlfd.c b/app/text/gimptext-xlfd.c index b70ba665a2..6b5b3e1a06 100644 --- a/app/text/gimptext-xlfd.c +++ b/app/text/gimptext-xlfd.c @@ -106,11 +106,19 @@ gimp_text_font_name_from_xlfd (const gchar *xlfd) switch (*fields[i]) { case 'i': +#ifndef _UCRT strcpy (buffers[i], "italic"); +#else + strcpy_s (buffers[i], sizeof (buffers[i]), "italic"); +#endif i++; break; case 'o': +#ifndef _UCRT strcpy (buffers[i], "oblique"); +#else + strcpy_s (buffers[i], sizeof (buffers[i]), "oblique"); +#endif i++; break; case 'r': diff --git a/app/widgets/gimpfileprocview.c b/app/widgets/gimpfileprocview.c index 848c58d9f0..ca3f4d9074 100644 --- a/app/widgets/gimpfileprocview.c +++ b/app/widgets/gimpfileprocview.c @@ -504,9 +504,17 @@ gimp_file_proc_view_pattern_from_extension (const gchar *extension, pattern = g_new (gchar, 6 + 4 * len); if (is_meta) +#ifndef _UCRT strcpy (pattern, "*.*."); +#else + strcpy_s (pattern, 6 + 4 * len, "*.*."); +#endif else +#ifndef _UCRT strcpy (pattern, "*."); +#else + strcpy_s (pattern, 6 + 4 * len, "*."); +#endif for (i = 0, p = pattern + 2; i < len; i++, p+= 4) { diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c index d9e4b254e0..62754ebdb7 100644 --- a/app/xcf/xcf-save.c +++ b/app/xcf/xcf-save.c @@ -332,7 +332,11 @@ xcf_save_image (XcfInfo *info, } else { +#ifndef _UCRT strcpy (version_tag, "gimp xcf file"); +#else + strcpy_s (version_tag, sizeof (version_tag), "gimp xcf file"); +#endif } xcf_write_int8_check_error (info, (guint8 *) version_tag, 14, ;); diff --git a/plug-ins/common/animation-optimize.c b/plug-ins/common/animation-optimize.c index 38ab80b29d..9043cfd7bf 100644 --- a/plug-ins/common/animation-optimize.c +++ b/plug-ins/common/animation-optimize.c @@ -1372,7 +1372,11 @@ remove_disposal_tag (gchar *dest, length = strlen (src); +#ifndef _UCRT strcpy (dest, src); +#else + strcpy_s (dest, length + 1, src); +#endif while (offset<=length) { @@ -1400,7 +1404,11 @@ remove_ms_tag (gchar *dest, length = strlen (src); +#ifndef _UCRT strcpy (dest, src); +#else + strcpy_s (dest, length + 1, src); +#endif while (offset<=length) { diff --git a/plug-ins/common/compose.c b/plug-ins/common/compose.c index fbfa9f1b8c..14b083265e 100644 --- a/plug-ins/common/compose.c +++ b/plug-ins/common/compose.c @@ -1422,8 +1422,14 @@ compose_dialog (GimpProcedure *procedure, composevals.inputs[j].comp.val = composeint.selected[j].comp.val; } +#ifndef _UCRT strcpy (composevals.compose_type, compose_dsc[compose_idx].compose_type); +#else + strcpy_s (composevals.compose_type, + sizeof (composevals.compose_type), + compose_dsc[compose_idx].compose_type); +#endif } return run; diff --git a/plug-ins/common/file-cel.c b/plug-ins/common/file-cel.c index 7c68ef2a7e..65b01c540e 100644 --- a/plug-ins/common/file-cel.c +++ b/plug-ins/common/file-cel.c @@ -844,7 +844,11 @@ export_image (GFile *file, /* Headers */ memset (header, 0, 32); +#ifndef _UCRT strcpy ((gchar *) header, "KiSS"); +#else + strcpy_s ((gchar *) header, sizeof(header), "KiSS"); +#endif header[4]= 0x20; /* Work out whether to save as 8bit or 4bit */ diff --git a/plug-ins/common/file-dicom.c b/plug-ins/common/file-dicom.c index 49742fa0da..d0cf1393f2 100644 --- a/plug-ins/common/file-dicom.c +++ b/plug-ins/common/file-dicom.c @@ -444,7 +444,11 @@ load_image (GFile *file, element_length_chars[1] = value_rep[1]; /* Unknown value rep. It is not used right now anyhow */ +#ifndef _UCRT strcpy (value_rep, "??"); +#else + strcpy_s (value_rep, sizeof (value_rep), "??"); +#endif /* For implicit value_values the length is always four bytes, so we need to read another two. */ diff --git a/plug-ins/common/plugin-browser.c b/plug-ins/common/plugin-browser.c index 728c5f1788..62f01de615 100644 --- a/plug-ins/common/plugin-browser.c +++ b/plug-ins/common/plugin-browser.c @@ -474,7 +474,11 @@ browser_search (GimpBrowser *gimp_browser, } else { +#ifndef _UCRT strcpy (xtimestr, ""); +#else + strcpy_s (xtimestr, sizeof (xtimestr), ""); +#endif } pinfo = g_new0 (PInfo, 1); diff --git a/plug-ins/file-ico/ico-export.c b/plug-ins/file-ico/ico-export.c index 3be9ae5f66..735c901252 100644 --- a/plug-ins/file-ico/ico-export.c +++ b/plug-ins/file-ico/ico-export.c @@ -1377,13 +1377,21 @@ ani_export_image (GFile *file, } /* Writing the .ani header data */ +#ifndef _UCRT strcpy (id, "RIFF"); +#else + strcpy_s (id, sizeof (id), "RIFF"); +#endif size = 0; fwrite (id, 4, 1, fp); ofs_size_riff = ftell (fp); fwrite (&size, sizeof (size), 1, fp); +#ifndef _UCRT strcpy (id, "ACON"); +#else + strcpy_s (id, sizeof (id), "ACON"); +#endif fwrite (id, 4, 1, fp); if ((ani_info->inam && strlen (ani_info->inam) > 0) || @@ -1391,16 +1399,28 @@ ani_export_image (GFile *file, { gint32 string_size; +#ifndef _UCRT strcpy (id, "LIST"); +#else + strcpy_s (id, sizeof (id), "LIST"); +#endif fwrite (id, 4, 1, fp); ofs_size_info = ftell (fp); fwrite (&size, sizeof (size), 1, fp); +#ifndef _UCRT strcpy (id, "INFO"); +#else + strcpy_s (id, sizeof (id), "INFO"); +#endif fwrite (id, 4, 1, fp); if (ani_info->inam && strlen (ani_info->inam) > 0) /* Cursor name */ { +#ifndef _UCRT strcpy (id, "INAM"); +#else + strcpy_s (id, sizeof (id), "INAM"); +#endif fwrite (id, 4, 1, fp); string_size = strlen (ani_info->inam) + 1; fwrite (&string_size, 4, 1, fp); @@ -1413,7 +1433,11 @@ ani_export_image (GFile *file, } if (ani_info->iart && strlen (ani_info->iart) > 0) /* Author name */ { +#ifndef _UCRT strcpy (id, "IART"); +#else + strcpy_s (id, sizeof (id), "IART"); +#endif fwrite (id, 4, 1, fp); string_size = strlen (ani_info->iart) + 1; fwrite (&string_size, 4, 1, fp); @@ -1432,21 +1456,37 @@ ani_export_image (GFile *file, fseek (fp, 0L, SEEK_END); } + #ifndef _UCRT strcpy (id, "anih"); +#else + strcpy_s (id, sizeof (id), "anih"); +#endif size = sizeof (*header); fwrite (id, 4, 1, fp); fwrite (&size, sizeof (size), 1, fp); fwrite (header, sizeof (*header), 1, fp); +#ifndef _UCRT strcpy (id, "LIST"); +#else + strcpy_s (id, sizeof (id), "LIST"); +#endif fwrite (id, 4, 1, fp); ofs_size_list = ftell (fp); fwrite (&size, sizeof (size), 1, fp); +#ifndef _UCRT strcpy (id, "fram"); +#else + strcpy_s (id, sizeof (id), "fram"); +#endif fwrite (id, 4, 1, fp); +#ifndef _UCRT strcpy (id, "icon"); +#else + strcpy_s (id, sizeof (id), "icon"); +#endif for (i = 0; i < info.num_icons; i++ ) { GimpPDBStatusType status; diff --git a/plug-ins/script-fu/libscriptfu/tinyscheme/string-port.c b/plug-ins/script-fu/libscriptfu/tinyscheme/string-port.c index 889e51ab74..608e4d5a2d 100644 --- a/plug-ins/script-fu/libscriptfu/tinyscheme/string-port.c +++ b/plug-ins/script-fu/libscriptfu/tinyscheme/string-port.c @@ -146,7 +146,11 @@ input_port_struct_from_string (scheme *sc, char *start) { } /* Assert strcpy writes NUL at end of buffer. */ +#ifndef _UCRT strcpy (copy, start); +#else + strcpy_s (copy, buffer_size_bytes, start); +#endif init_port_struct (port_struct, port_string | port_input, copy, buffer_size_bytes); @@ -296,7 +300,11 @@ output_port_expand_by_at_least (scheme *sc, port *p, size_t byte_count) memset (new_buffer, '\0', new_size); /* This copies the terminating NUL. */ +#ifndef _UCRT strcpy (new_buffer, current_contents); +#else + strcpy_s (new_buffer, new_size, current_contents); +#endif reset_output_port_struct (p, new_buffer, new_size, new_curr);