aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/getopt.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib-src/getopt.c b/lib-src/getopt.c
index 570cb9da69e..2d3f3b64bf2 100644
--- a/lib-src/getopt.c
+++ b/lib-src/getopt.c
@@ -331,9 +331,9 @@ exchange (argv)
331 nonoption_flags_len = nonoption_flags_max_len = 0; 331 nonoption_flags_len = nonoption_flags_max_len = 0;
332 else 332 else
333 { 333 {
334 memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len); 334 memset (__mempcpy (new_str, __getopt_nonoption_flags,
335 memset (&new_str[nonoption_flags_max_len], '\0', 335 nonoption_flags_max_len),
336 top + 1 - nonoption_flags_max_len); 336 '\0', top + 1 - nonoption_flags_max_len);
337 nonoption_flags_max_len = top + 1; 337 nonoption_flags_max_len = top + 1;
338 __getopt_nonoption_flags = new_str; 338 __getopt_nonoption_flags = new_str;
339 } 339 }
@@ -442,11 +442,8 @@ _getopt_initialize (argc, argv, optstring)
442 if (__getopt_nonoption_flags == NULL) 442 if (__getopt_nonoption_flags == NULL)
443 nonoption_flags_max_len = -1; 443 nonoption_flags_max_len = -1;
444 else 444 else
445 { 445 memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
446 memcpy (__getopt_nonoption_flags, orig_str, len); 446 '\0', nonoption_flags_max_len - len);
447 memset (&__getopt_nonoption_flags[len], '\0',
448 nonoption_flags_max_len - len);
449 }
450 } 447 }
451 } 448 }
452 nonoption_flags_len = nonoption_flags_max_len; 449 nonoption_flags_len = nonoption_flags_max_len;