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

* error.c (get_syserror): use snprintf() instead of sprintf(). pointed

out by knu.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2003-01-26 18:31:03 +00:00
parent 2403d9188d
commit ec458f636c
2 changed files with 9 additions and 3 deletions

View file

@ -1,6 +1,12 @@
Mon Jan 27 03:30:06 2003 NAKAMURA Usaku <usa@ruby-lang.org>
* error.c (get_syserror): use snprintf() instead of sprintf(). pointed
out by knu.
Mon Jan 27 02:06:38 2003 NAKAMURA Usaku <usa@ruby-lang.org> Mon Jan 27 02:06:38 2003 NAKAMURA Usaku <usa@ruby-lang.org>
* error.c (get_syserror): some Windows' errno have 5 digits. * error.c (get_syserror): some Windows' errno have 5 digits. pointed
out by znz.
Sun Jan 26 19:23:10 2003 NAKAMURA Usaku <usa@ruby-lang.org> Sun Jan 26 19:23:10 2003 NAKAMURA Usaku <usa@ruby-lang.org>
@ -221,7 +227,7 @@ Sun Jan 19 23:08:18 2003 Akinori MUSHA <knu@iDaemons.org>
Sun Jan 19 14:01:12 2003 UENO Katsuhiro <unnie@blue.sky.or.jp> Sun Jan 19 14:01:12 2003 UENO Katsuhiro <unnie@blue.sky.or.jp>
* regex.c (is_in_list): should work weill with UTF-8. * regex.c (is_in_list): should work well with UTF-8.
* regex.c (re_match_exec): ditto. * regex.c (re_match_exec): ditto.

View file

@ -497,7 +497,7 @@ get_syserr(int n)
if (!st_lookup(syserr_tbl, n, &error)) { if (!st_lookup(syserr_tbl, n, &error)) {
char name[8]; /* some Windows' errno have 5 digits. */ char name[8]; /* some Windows' errno have 5 digits. */
sprintf(name, "E%03d", n); snprintf(name, sizeof(name), "E%03d", n);
error = set_syserr(n, name); error = set_syserr(n, name);
} }
return error; return error;