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