mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtlogin: resolve more static analysis warnings
This commit is contained in:
parent
c768260785
commit
ab743c37e6
9 changed files with 30 additions and 11 deletions
|
@ -565,7 +565,7 @@ binaryEqual (char *a, char *b, unsigned short len)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
static void
|
||||
dumpBytes (unsigned short len, char *data)
|
||||
{
|
||||
unsigned short i;
|
||||
|
@ -709,7 +709,7 @@ writeAuth (file, auth)
|
|||
dumpAuth (auth); /* does Debug only */
|
||||
}
|
||||
|
||||
if (doWrite)
|
||||
if (doWrite) {
|
||||
if (!XauWriteAuth (file, auth) || fflush (file) == EOF) {
|
||||
LogError(
|
||||
ReadCatalog(MC_LOG_SET,MC_LOG_SRV_WRT,MC_DEF_LOG_SRV_WRT),
|
||||
|
@ -717,7 +717,11 @@ writeAuth (file, auth)
|
|||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -425,6 +425,7 @@ ProcessChooserSocket (
|
|||
}
|
||||
|
||||
close (client_fd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -397,7 +397,6 @@ AddHostname (ARRAY8Ptr hostname, ARRAY8Ptr status, struct sockaddr *addr, int wi
|
|||
}
|
||||
if (!XdmcpAllocARRAY8 (&new->hostaddr, hostAddr.length))
|
||||
{
|
||||
free ((char *) new->fullname);
|
||||
free ((char *) new);
|
||||
return 0;
|
||||
}
|
||||
|
@ -759,6 +758,9 @@ Choose (HostName *h)
|
|||
addr = (struct sockaddr *) &in_addr;
|
||||
len = sizeof (in_addr);
|
||||
break;
|
||||
default:
|
||||
fprintf (stderr, "Unhandled protocol family %d\n", family);
|
||||
exit (REMANAGE_DISPLAY);
|
||||
}
|
||||
if ((fd = socket (family, SOCK_STREAM, 0)) == -1)
|
||||
{
|
||||
|
|
|
@ -171,7 +171,8 @@ void
|
|||
TrimErrorFile( void )
|
||||
{
|
||||
|
||||
int f1, f2;
|
||||
int f1 = -1;
|
||||
int f2 = -1;
|
||||
int deleteBytes;
|
||||
|
||||
char buf[BUFSIZ];
|
||||
|
|
|
@ -210,6 +210,7 @@ ParseDisplay( char *source,
|
|||
LogError(ReadCatalog(MC_LOG_SET,MC_LOG_MISS_TYPE,MC_DEF_LOG_MISS_TYPE),
|
||||
args[0]);
|
||||
freeArgs (args);
|
||||
free(name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -478,6 +478,8 @@ InitCryptoKey( void )
|
|||
|
||||
}
|
||||
cryptoInited = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif /* HASXDMAUTH */
|
||||
|
|
|
@ -164,14 +164,16 @@ Willing(
|
|||
#endif
|
||||
ret = AcceptableDisplayAddress (addr, connectionType, type);
|
||||
if (!ret)
|
||||
sprintf (statusBuf, "Display not authorized to connect");
|
||||
snprintf (statusBuf, sizeof(statusBuf), "Display not authorized to connect");
|
||||
else
|
||||
sprintf (statusBuf, "%s", WillingMsg());
|
||||
snprintf (statusBuf, sizeof(statusBuf), "%s", WillingMsg());
|
||||
#if 0
|
||||
sprintf (statusBuf, "host %s", localHostname());
|
||||
snprintf (statusBuf, sizeof(statusBuf), "host %s", localHostname());
|
||||
#endif
|
||||
/* enforce termination */
|
||||
statusBuf[255] = '\0';
|
||||
|
||||
status->length = strlen (statusBuf);
|
||||
status->length = strlen(statusBuf);
|
||||
status->data = (CARD8Ptr) malloc (status->length);
|
||||
if (!status->data)
|
||||
status->length = 0;
|
||||
|
|
|
@ -644,7 +644,7 @@ int
|
|||
LoadXloginResources( struct display *d )
|
||||
{
|
||||
char cmd[1024];
|
||||
char *language="";
|
||||
char *language = NULL;
|
||||
char *lang_key="";
|
||||
char *authority="";
|
||||
char *auth_key="";
|
||||
|
@ -1943,6 +1943,8 @@ RunGreeter( struct display *d, struct greet_info *greet,
|
|||
char *path;
|
||||
struct greet_state state = {};
|
||||
int notify_dt;
|
||||
int dupfp = -1;
|
||||
int dupfp2 = -1;
|
||||
|
||||
#ifdef __PASSWD_ETC
|
||||
# ifndef U_NAMELEN
|
||||
|
@ -2126,7 +2128,8 @@ RunGreeter( struct display *d, struct greet_info *greet,
|
|||
* Writing to file descriptor 1 goes to response pipe instead.
|
||||
*/
|
||||
close(1);
|
||||
if(-1 == dup(response[1])) {
|
||||
dupfp = dup(response[1]);
|
||||
if(-1 == dupfp) {
|
||||
perror(strerror(errno));
|
||||
}
|
||||
close(response[0]);
|
||||
|
@ -2136,7 +2139,8 @@ RunGreeter( struct display *d, struct greet_info *greet,
|
|||
* Reading from file descriptor 0 reads from request pipe instead.
|
||||
*/
|
||||
close(0);
|
||||
if(-1 == dup(request[0])) {
|
||||
dupfp2 = dup(request[0]);
|
||||
if(-1 == dupfp2) {
|
||||
perror(strerror(errno));
|
||||
}
|
||||
close(request[0]);
|
||||
|
|
|
@ -1242,6 +1242,8 @@ RequestCB(
|
|||
XmFONTLIST_DEFAULT_TAG));
|
||||
string = XmStringConcat(xmstr, XmStringSeparatorCreate());
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue