summaryrefslogtreecommitdiff
path: root/dln.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-17 01:29:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-17 01:29:17 +0000
commit22cde7b682328ba195ce0ee214edb6c2feb81b23 (patch)
tree7873fbf3dad59cb2042390c1c2dbfe90d5b6e647 /dln.c
parentea9628c3bc700c5162a6298b79d2b8cd7a334fea (diff)
* 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
Diffstat (limited to 'dln.c')
-rw-r--r--dln.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dln.c b/dln.c
index ae22c69..6e2298d 100644
--- a/dln.c
+++ b/dln.c
@@ -127,7 +127,7 @@ init_funcname_len(char **buf, const char *file)
free(*buf);\
rb_memerror();\
}\
- strcpy(tmp, *buf);\
+ strlcpy(tmp, *buf, len + 1);\
free(*buf);\
*buf = tmp;\
} while (0)
@@ -1224,7 +1224,7 @@ dln_load(const char *file)
/* Load the file as an object one */
init_funcname(&buf, file);
- strcpy(winfile, file);
+ strlcpy(winfile, file, sizeof(winfile));
/* Load file */
if ((handle = LoadLibrary(winfile)) == NULL) {
@@ -1669,7 +1669,7 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
fprintf(stderr, "\tFile \"%s%s\"\n", fname, extension[j]);
continue;
}
- strcpy(bp + i, extension[j]);
+ strlcpy(bp + i, extension[j], fspace);
if (stat(fbuf, &st) == 0)
return fbuf;
}