1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Resolve some coverity warnings

This commit is contained in:
Peter Howkins 2018-03-08 23:03:21 +00:00
parent 35a16f47df
commit 637abd5d5c
10 changed files with 89 additions and 50 deletions

View file

@ -57,6 +57,8 @@
*****************************************************************************
*************************************<+>*************************************/
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <ctype.h>
#include <sys/wait.h>
#include <sys/types.h>
@ -1161,7 +1163,10 @@ SetSavePath(
smGD.resourcePath[0] = 0;
return(-1);
}
chmod(smGD.clientPath, 0755);
if(-1 == chmod(smGD.clientPath, 0755))
{
fprintf(stderr, "%s chmod error %s\n", smGD.clientPath, strerror(errno));
}
}
else
{
@ -1293,7 +1298,10 @@ SetFontSavePath(char *langPtr)
smGD.fontPath[0] = 0;
return(-1);
}
chmod(smGD.fontPath, 0755);
if(-1 == chmod(smGD.fontPath, 0755))
{
fprintf(stderr, "%s chmod error %s\n", smGD.fontPath, strerror(errno));
}
}
/*

View file

@ -161,8 +161,8 @@ static Boolean CanReAuthenticate(char *name, uid_t uid, char *passwd,
{
Boolean fail = False;
*pwent = (name == NULL) ? getpwuid(uid) : getpwnam(name);
if (pwent)
*pwent = (name == NULL) ? getpwuid(uid) : getpwnam(name);
*spent = getspnam((*pwent)->pw_name);
#ifdef JET_AUTHDEBUG

View file

@ -2013,6 +2013,7 @@ RestoreClients( void )
SM_FREE((char *) remoteBuf[i]);
}
}
free(displayName);
return(-1);
}
hintPtr = NULL;

View file

@ -1620,12 +1620,12 @@ OutputResource( void )
langPtr = getenv("LANG");
if((langPtr != NULL) && (*langPtr != 0))
{
sprintf(resSpec, "%s*%s: %s\n", SM_RESOURCE_NAME, SmNsessionLang,
snprintf(resSpec, resSize, "%s*%s: %s\n", SM_RESOURCE_NAME, SmNsessionLang,
langPtr);
}
else
{
sprintf(resSpec, "%s*%s: \n", SM_RESOURCE_NAME, SmNsessionLang);
snprintf(resSpec, resSize, "%s*%s: \n", SM_RESOURCE_NAME, SmNsessionLang);
}
fltYRes = ((float) DisplayHeight(smGD.display, 0) /