Another nice cleanup from Larry. This adds a new last_char_is() function and

uses it to avoid possible buffer underruns whn strlen is zero, and avoid the
possible space-hogging inline of strlen() in several cases.
 -Erik
This commit is contained in:
Eric Andersen 2001-04-26 15:56:47 +00:00
parent 3c3277f0bd
commit c1bdffe99b
12 changed files with 46 additions and 11 deletions

View file

@ -75,7 +75,7 @@ static void decompose_list(const char *list)
/* handle multi-value cases */
else if (nminus == 1) {
/* handle 'N-' case */
if (list[strlen(list) - 1] == '-') {
if (last_char_is(list,'-')) {
startpos = strtol(list, &ptr, 10);
}
/* handle '-M' case */