* lib/tcbfuncs.c: Avoid integer to char conversions.

This commit is contained in:
nekral-guest 2010-03-18 00:04:05 +00:00
parent 37b4c8737f
commit ee15c8717f
2 changed files with 3 additions and 2 deletions

View File

@ -15,6 +15,7 @@
spw_setdbname's prototype.
* lib/tcbfuncs.c: Ignore fflush() return value.
* lib/tcbfuncs.c: Avoid implicit signed to unsigned conversions.
* lib/tcbfuncs.c: Avoid integer to char conversions.
2010-03-17 Nicolas François <nicolas.francois@centraliens.net>

View File

@ -192,7 +192,7 @@ static shadowtcb_status mkdir_leading(const char *name, uid_t uid)
goto out_free_path;
}
while ((ind = strchr(ptr, '/'))) {
*ind = 0;
*ind = '\0';
if (asprintf(&dir, TCB_DIR "/%s", path) == -1) {
OUT_OF_MEMORY;
return SHADOWTCB_FAILURE;
@ -250,7 +250,7 @@ static shadowtcb_status rmdir_leading(char *path)
char *ind, *dir;
shadowtcb_status ret = SHADOWTCB_SUCCESS;
while ((ind = strrchr(path, '/'))) {
*ind = 0;
*ind = '\0';
if (asprintf(&dir, TCB_DIR "/%s", path) == -1) {
OUT_OF_MEMORY;
return SHADOWTCB_FAILURE;