Skip to content

Commit b50b6dd

Browse files
committed
Replace str2long with strtol.
1 parent 7d1a108 commit b50b6dd

File tree

6 files changed

+2
-47
lines changed

6 files changed

+2
-47
lines changed

lang/pc/comp/LLlex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ int LLlex(void)
522522
np = &buf[1];
523523
while (*np == '0') /* skip leading zeros */
524524
np++;
525-
tk->TOK_INT = str2long(np, 10);
525+
tk->TOK_INT = strtol(np, NULL, 10);
526526
if( (tk->TOK_INT < 0) ||
527527
(strlen(np) > strlen(maxint_str)) ||
528528
(strlen(np) == strlen(maxint_str) &&

modules/src/read_em/reade.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static int getnumber(int c, struct e_arg *ap)
353353
}
354354

355355
ungetbyte(c);
356-
ap->ema_cst = (arith) str2long(str, 10);
356+
ap->ema_cst = (arith) strtol(str, NULL, 10);
357357
return sp_cst4;
358358
}
359359

modules/src/string/ack_string.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#define __ACK_STRING_INCLUDED__
99

1010
char *long2str(long l, int b);
11-
long str2long(char *s, int b);
1211
char *btscpy(char *b1, char *b2, int n);
1312
char *bts2str(char *b, int n, char *s);
1413

modules/src/string/build.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ clibrary {
33
srcs = {
44
"./bts2str.c",
55
"./btscpy.c","./long2str.c",
6-
"./str2long.c",
76
},
87
hdrs = { "./ack_string.h", },
98
}

modules/src/string/str2long.c

Lines changed: 0 additions & 36 deletions
This file was deleted.

modules/src/string/string.3

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ conversions between strings and row of bytes
1111
.PP
1212
.B char *long2str(long l, int b)
1313
.PP
14-
.B long str2long(char *s, int b)
15-
.PP
1614
.B char *btscpy(char *b1, char *b2, int n)
1715
.PP
1816
.B char *bts2str(char *b, int n, char *s)
@@ -60,11 +58,6 @@ This base may be any of 2..16.
6058
A negative base (in the range -16..-2) indicates that the long must be
6159
seen as unsigned.
6260
A pointer to the string is returned.
63-
.I str2long
64-
returns the value that is represented in
65-
.IR s ,
66-
according to
67-
.IR base .
6861
.PP
6962
.I btscpy
7063
copies

0 commit comments

Comments
 (0)