[Clamav-devel] [PATCH] performance/correctness/size fix for isnumb()

2005-04-15 Thread Denis Vlasenko
Correctness first: # man isdigit ISALPHA(3) Linux Programmer's Manual ISALPHA(3) NAME isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower, isprint, ispunct, isspace, isupper, isxdigit - character classification routines SYNOPSIS

Re: [Clamav-devel] [PATCH] performance/correctness/size fix for isnumb()

2005-04-15 Thread Nigel Horne
for(i=0; istrlen(s); i++)... has quadratic run time. Not a problem in current code (it is never called on more than LINE_LENGTH (1024) bytes, thus touches 'only' 500 Kbytes at most), but it is not a good practice anyway. Especially since we don't need strlen() here _at all_. I talked about