diff options
author | John Tytgat <joty@netsurf-browser.org> | 2008-03-09 16:34:57 +0000 |
---|---|---|
committer | John Tytgat <joty@netsurf-browser.org> | 2008-03-09 16:34:57 +0000 |
commit | 62d2e47936663017520b102df9c5be66e20cafd9 (patch) | |
tree | 5351ab25566e5155d14d8673052ee75c7ac5e992 /utils | |
parent | cdea9de987de9d8f7958c523110dc3f6d0c87358 (diff) | |
download | netsurf-62d2e47936663017520b102df9c5be66e20cafd9.tar.gz netsurf-62d2e47936663017520b102df9c5be66e20cafd9.tar.bz2 |
Avoid magic numbers.
svn path=/trunk/netsurf/; revision=3907
Diffstat (limited to 'utils')
-rw-r--r-- | utils/utf8.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/utf8.c b/utils/utf8.c index e734cfad6..6afcbaf88 100644 --- a/utils/utf8.c +++ b/utils/utf8.c @@ -295,8 +295,8 @@ utf8_convert_ret utf8_convert(const char *string, size_t len, /* we cache the last used conversion descriptor, * so check if we're trying to use it here */ - if (strncasecmp(last_cd.from, from, 32) == 0 && - strncasecmp(last_cd.to, to, 32) == 0) { + if (strncasecmp(last_cd.from, from, sizeof(last_cd.from)) == 0 && + strncasecmp(last_cd.to, to, sizeof(last_cd.to)) == 0) { cd = last_cd.cd; } else { @@ -314,8 +314,8 @@ utf8_convert_ret utf8_convert(const char *string, size_t len, iconv_close(last_cd.cd); /* and copy the to/from/cd data into last_cd */ - strncpy(last_cd.from, from, 32); - strncpy(last_cd.to, to, 32); + strncpy(last_cd.from, from, sizeof(last_cd.from)); + strncpy(last_cd.to, to, sizeof(last_cd.to)); last_cd.cd = cd; } |