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/branches/ruby_1_6@3417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2003-01-26 18:31:03 +00:00
parent 51cbee1378
commit 4ee8807e85
2 changed files with 8 additions and 2 deletions

View file

@ -439,7 +439,7 @@ get_syserr(int n)
if (!st_lookup(syserr_tbl, n, &error)) {
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);
}
return error;