diff options
author | Thorsten Kukuk <kukuk@thkukuk.de> | 2009-02-25 17:05:22 +0000 |
---|---|---|
committer | Thorsten Kukuk <kukuk@thkukuk.de> | 2009-02-25 17:05:22 +0000 |
commit | 48a26b6141fb6bf276208bc1a06f5105880e843e (patch) | |
tree | defea3b1a9bc97dd09ec62f62129cdf37666ad9e /libpam | |
parent | 1376c1565abb318a5b4d086edd7f295ee3da6b13 (diff) | |
download | pam-48a26b6141fb6bf276208bc1a06f5105880e843e.tar.gz pam-48a26b6141fb6bf276208bc1a06f5105880e843e.tar.bz2 pam-48a26b6141fb6bf276208bc1a06f5105880e843e.zip |
Relevant BUGIDs:
Purpose of commit: bugfix
Commit summary:
---------------
2009-02-25 Thorsten Kukuk <kukuk@thkukuk.de>
* libpam/pam_misc.c (_pam_StrTok): Use unsigned char
instead of int. Reported by Marcus Granado.
* tests/Makefile.am (TESTS): Add tst-pam_mkargv.
* tests/tst-pam_mkargv.c (main): Test case for
_pam_mkargv.
* po/de.po: Update fuzzy translations.
Diffstat (limited to 'libpam')
-rw-r--r-- | libpam/pam_misc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libpam/pam_misc.c b/libpam/pam_misc.c index 574a570e..b690fd3e 100644 --- a/libpam/pam_misc.c +++ b/libpam/pam_misc.c @@ -59,10 +59,11 @@ char *_pam_StrTok(char *from, const char *format, char **next) /* initialize table */ for (i=1; i<256; table[i++] = '\0'); - for (i=0; format[i] ; table[(int)format[i++]] = 'y'); + for (i=0; format[i] ; + table[(unsigned char)format[i++]] = 'y'); /* look for first non-format char */ - while (*from && table[(int)*from]) { + while (*from && table[(unsigned char)*from]) { ++from; } @@ -92,7 +93,7 @@ char *_pam_StrTok(char *from, const char *format, char **next) remains */ } else if (*from) { /* simply look for next blank char */ - for (end=from; *end && !table[(int)*end]; ++end); + for (end=from; *end && !table[(unsigned char)*end]; ++end); } else { return (*next = NULL); /* no tokens left */ } |