[hackers] [sbase] printf: remove unnecessary string size test || Quentin Rameau
commit 243cdb6669544a55d84a7d223ec2517d1e2cb43a
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Mon Feb 29 15:35:13 2016 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Tue Mar 1 11:14:42 2016 +0000
printf: remove unnecessary string size test
diff --git a/printf.c b/printf.c
index 72cbe46..52d97e1 100644
--- a/printf.c
+++ b/printf.c
_AT_@ -18,7 +18,7 @@ int
main(int argc, char *argv[])
{
Rune *rarg;
- size_t i, j, argi, lastargi, formatlen, arglen;
+ size_t i, j, argi, lastargi, formatlen;
long long num;
double dou;
int cooldown = 0, width, precision;
_AT_@ -127,8 +127,7 @@ main(int argc, char *argv[])
printf("%*.*s", width, precision, arg);
break;
case 'd': case 'i': case 'o': case 'u': case 'x': case 'X':
- arglen = strlen(arg);
- for (j = 0; j < arglen && isspace(arg[j]); j++);
+ for (j = 0; isspace(arg[j]); j++);
if (arg[j] == '\'' || arg[j] == '\"') {
arg += j + 1;
unescape(arg);
Received on Tue Mar 01 2016 - 12:14:50 CET
This archive was generated by hypermail 2.3.0
: Tue Mar 01 2016 - 12:24:20 CET