1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,

string.c, util.c, variable.c: use strlcpy, memcpy and snprintf
  instead of strcpy, strncpy and sprintf.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-03-17 01:29:17 +00:00
parent ea9628c3bc
commit 22cde7b682
11 changed files with 46 additions and 35 deletions

View file

@ -243,7 +243,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
savetz = (char *) malloc(tzlen + 1);
if (savetz != NULL) {
savetzlen = tzlen + 1;
strcpy(savetz, tz);
memcpy(savetz, tz, savetzlen);
}
}
tzset();
@ -256,10 +256,10 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
savetz = (char *) realloc(savetz, i);
if (savetz) {
savetzlen = i;
strcpy(savetz, tz);
memcpy(savetz, tz, i);
}
} else
strcpy(savetz, tz);
memcpy(savetz, tz, i);
tzset();
}
#endif /* POSIX_SEMANTICS */