diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-08-27 16:39:40 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-08-27 16:39:40 +0000 |
commit | 4b972522572d98583dd88146ad983bc11cc0c3ff (patch) | |
tree | 839ef47f3d567b06c4ffee966c076cbc05b00eec /parsetagx.c | |
parent | [w3m-dev 03290] Re: Forward: Bug#157098: wrong file presentation on large files (diff) | |
download | w3m-4b972522572d98583dd88146ad983bc11cc0c3ff.tar.gz w3m-4b972522572d98583dd88146ad983bc11cc0c3ff.zip |
* [w3m-dev 03291] parsetagx.c:toNumber()
* parsetagx.c (toNumber): don't parse non-number value as 0,
just ignore
From: Kiyokazu SUTO <suto@ks-and-ks.ne.jp>
Diffstat (limited to 'parsetagx.c')
-rw-r--r-- | parsetagx.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/parsetagx.c b/parsetagx.c index fb6e9a5..0742260 100644 --- a/parsetagx.c +++ b/parsetagx.c @@ -1,4 +1,4 @@ -/* $Id: parsetagx.c,v 1.8 2002/01/31 17:54:53 ukai Exp $ */ +/* $Id: parsetagx.c,v 1.9 2002/08/27 16:39:40 ukai Exp $ */ #include "fm.h" #include "myctype.h" #include "indep.h" @@ -42,8 +42,17 @@ noConv(char *oval, char **str) static int toNumber(char *oval, int *num) { - *num = atoi(oval); - return 1; + char *ep; + int x; + + x = strtol(oval, &ep, 0); + + if (ep > oval) { + *num = x; + return 1; + } + else + return 0; } static int |