summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-17 05:10:22 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-17 05:10:22 (GMT)
commite4820b1cfadbd7cbd5713d774a0bc0db527e479d (patch)
treeff30369a26b31a4cb3d1fa954ade25f56ab89001 /util.c
parent4bf3cb5ba9c0242bd5a6d0d55b7db9f837c09edf (diff)
* util.c (ruby_add_suffix): fixed type warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r--util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/util.c b/util.c
index 3685586..363868d 100644
--- a/util.c
+++ b/util.c
@@ -266,9 +266,8 @@ extern const char *ruby_find_extname(const char *, long *);
void
ruby_add_suffix(VALUE str, const char *suffix)
{
- int baselen;
- int extlen = strlen(suffix);
- char *p, *q;
+ long baselen;
+ long extlen = strlen(suffix);
long slen;
char buf[1024];
const char *name;
@@ -299,11 +298,12 @@ ruby_add_suffix(VALUE str, const char *suffix)
rb_str_cat(str, suffix, extlen);
}
else {
+ char *p = buf, *q;
strncpy(buf, name, slen);
if (ext)
- p = buf + (ext - name);
+ p += (ext - name);
else
- p = buf + slen;
+ p += slen;
p[len] = '\0';
if (suffix[1] == '\0') { /* Style 2 */
if (len <= 3) {