mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-13 19:52:20 +00:00
libDtSvc: Resolve 89 compiler warnings.
This commit is contained in:
parent
92743e0999
commit
e9bb2bcf09
24 changed files with 84 additions and 83 deletions
|
@ -119,7 +119,7 @@ XeFindShortHost(XeString host_spec)
|
|||
if (ptr2 && strequal(ptr, ptr2)) { /* domains same, can eliminate */
|
||||
host = Xe_make_ntype(ptr-host_spec+1, XeChar);
|
||||
strncpy(host, host_spec, ptr-host_spec); /* copy only up to "." */
|
||||
host[ptr-host_spec] = NULL; /* NULL terminate copy */
|
||||
host[ptr-host_spec] = '\0'; /* NULL terminate copy */
|
||||
}
|
||||
else
|
||||
host = strdup(host_spec);
|
||||
|
@ -311,7 +311,7 @@ Xegetshorthostname(XeString buffer, unsigned int bufsize)
|
|||
if (status = gethostname(buffer, bufsize))
|
||||
return status; /* failed gethostname */
|
||||
if (ptr = strstr(buffer, (XeString)"."))
|
||||
*ptr = NULL; /* delete domain name if there is one */
|
||||
*ptr = '\0'; /* delete domain name if there is one */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -398,7 +398,7 @@ Xegetcwd(char *buf, int size)
|
|||
len = size-1;
|
||||
|
||||
strncpy(buf, current_dir, len);
|
||||
buf[len] = NULL;
|
||||
buf[len] = '\0';
|
||||
|
||||
/* Make sure $PWD is the same as "." before we trust it. */
|
||||
/* All this is still much faster the getcwd() esp. on UX discless. */
|
||||
|
|
|
@ -286,7 +286,7 @@ void SPC_Child_Terminated(int i)
|
|||
* as done.
|
||||
*/
|
||||
if (SPC_pid_list != NULL) {
|
||||
for (indx=0; SPC_pid_list[indx] != NULL; indx++)
|
||||
for (indx=0; SPC_pid_list[indx] != 0; indx++)
|
||||
if (SPC_pid_list[indx] == pid) {
|
||||
SPC_pid_list[indx] = SPCD_DEAD_PROCESS;
|
||||
break;
|
||||
|
@ -323,7 +323,7 @@ void SPC_Child_Terminated(int i)
|
|||
print_protocol_request((XeString) (XeString)" <-- INTERNAL APPLICATION_DIED", prot);
|
||||
}
|
||||
else {
|
||||
SPC_Change_State(channel, NULL, -1, 0);
|
||||
SPC_Change_State(channel, 0, -1, 0);
|
||||
if(channel->Terminate_Handler) {
|
||||
XeSPCGetProcessStatus(channel, &type, &cause);
|
||||
(* channel->Terminate_Handler)
|
||||
|
@ -474,7 +474,7 @@ int exec_proc_local_channel_object(SPC_Channel_Ptr channel)
|
|||
* If a dead pid entry exists, reuse it; otherwise, must create
|
||||
* room for the new pid.
|
||||
*/
|
||||
for (i = 0; SPC_pid_list[i] != NULL; i++)
|
||||
for (i = 0; SPC_pid_list[i] != 0; i++)
|
||||
if (SPC_pid_list[i] == SPCD_DEAD_PROCESS) {
|
||||
SPC_pid_list[i] = pid;
|
||||
reuse_pid = 1;
|
||||
|
@ -486,7 +486,7 @@ int exec_proc_local_channel_object(SPC_Channel_Ptr channel)
|
|||
}
|
||||
if (!reuse_pid) {
|
||||
SPC_pid_list[i] = pid;
|
||||
SPC_pid_list[i+1] = NULL;
|
||||
SPC_pid_list[i+1] = 0;
|
||||
}
|
||||
_DtSvcProcessUnlock();
|
||||
|
||||
|
|
|
@ -294,7 +294,7 @@ SPC_Open_Socket(SPC_Connection_Ptr conn,
|
|||
|
||||
struct servent *service;
|
||||
|
||||
conn->sid=socket(type, SOCK_STREAM, NULL);
|
||||
conn->sid=socket(type, SOCK_STREAM, 0);
|
||||
if(conn->sid == ERROR) {
|
||||
SPC_Error(SPC_Bad_Socket);
|
||||
return(SPC_ERROR);
|
||||
|
@ -406,7 +406,7 @@ SPC_Connection_Ptr SPC_Standalone_Daemon(SPC_Connection_Ptr conn)
|
|||
#if defined(__aix)
|
||||
if (setsockopt(conn->sid, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on))==ERROR) {
|
||||
#else
|
||||
if (setsockopt(conn->sid, SOL_SOCKET, SO_REUSEADDR, NULL, NULL)==ERROR) {
|
||||
if (setsockopt(conn->sid, SOL_SOCKET, SO_REUSEADDR, NULL, 0)==ERROR) {
|
||||
#endif
|
||||
SPC_Error(SPC_Bad_Reuse);
|
||||
return(SPC_ERROR);
|
||||
|
|
|
@ -71,7 +71,7 @@ object *alloc_channel_object(object_clasp c)
|
|||
/*----------------------------------------------------------------------+*/
|
||||
{
|
||||
object *p=(object *) XeMalloc((unsigned) c->object_size);
|
||||
memset(p, NULL, (int) c->object_size);
|
||||
memset(p, 0, (int) c->object_size);
|
||||
return(p);
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ static Wire dummy_wire={
|
|||
(XeString) "/dev/null", /* Master PTY */
|
||||
(XeString) "/dev/null", /* Slave PTY */
|
||||
0, 0, /* Toolkit IDs */
|
||||
NULL /* pointer to next wire */
|
||||
0 /* pointer to next wire */
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------+*/
|
||||
|
@ -234,7 +234,7 @@ void SPC_Channel_Terminated(SPC_Channel_Ptr channel)
|
|||
{
|
||||
int type, cause;
|
||||
|
||||
SPC_Change_State(channel, NULL, -1, 0);
|
||||
SPC_Change_State(channel, 0, -1, 0);
|
||||
|
||||
/* Set the close timeout. If we are on a PTY, we will return
|
||||
after two seconds if we are waiting for EOF */
|
||||
|
@ -596,7 +596,7 @@ int pre_fork_channel_object(SPC_Channel_Ptr channel)
|
|||
|
||||
/* Move to the "Running & (possibly) data ready" state */
|
||||
|
||||
SPC_Change_State(channel, NULL, flag, 1);
|
||||
SPC_Change_State(channel, 0, flag, 1);
|
||||
|
||||
|
||||
return(TRUE);
|
||||
|
|
|
@ -189,7 +189,7 @@ SPC_Connection_Ptr SPC_Alloc_Connection(void)
|
|||
_DtSvcProcessLock();
|
||||
conn=(SPC_Connection_Ptr) XeMalloc(sizeof(SPC_Connection));
|
||||
/* Zero the connection */
|
||||
memset(conn, NULL, sizeof(SPC_Connection));
|
||||
memset(conn, 0, sizeof(SPC_Connection));
|
||||
conn->queued_remote_data = Xe_make_queue(FALSE);
|
||||
conn->termination_id = (-1);
|
||||
/* Init the socket id to "-1" because "0" is a valid file descriptor. */
|
||||
|
@ -439,7 +439,7 @@ protocol_request_ptr SPC_Read_Protocol(SPC_Connection_Ptr connection)
|
|||
if(!connection->connected)
|
||||
return(SPC_ERROR);
|
||||
|
||||
if((prot=SPC_New_Protocol_Ptr(NULL, NULL, NULL))==SPC_ERROR) {
|
||||
if((prot=SPC_New_Protocol_Ptr(NULL, 0, 0))==SPC_ERROR) {
|
||||
SPC_Close_Connection(connection);
|
||||
return(SPC_ERROR);
|
||||
}
|
||||
|
@ -1159,12 +1159,12 @@ int SPC_Send_Multi_Packet(SPC_Connection_Ptr connection,
|
|||
|
||||
if(this_str == NULL)
|
||||
this_str = NULL_STR;
|
||||
if(*this_str == NULL)
|
||||
if(*this_str == '\0')
|
||||
this_str = EMPTY_STR;
|
||||
|
||||
tmp_len=strlen(this_str)+1; /* Room for NULL char */
|
||||
if((bytes_left-tmp_len) < 1) {
|
||||
*buf=NULL;
|
||||
*buf='\0';
|
||||
prot->dataptr->len=numbytes+1;
|
||||
SPC_Write_Single_Prot_Request(connection, name, prot);
|
||||
SPC_Free_Protocol_Ptr(prot);
|
||||
|
@ -1193,7 +1193,7 @@ int SPC_Send_Multi_Packet(SPC_Connection_Ptr connection,
|
|||
}
|
||||
|
||||
if(numbytes) {
|
||||
*buf=NULL;
|
||||
*buf='\0';
|
||||
prot->dataptr->len=numbytes+1;
|
||||
SPC_Write_Single_Prot_Request(connection, (XeString)" <-- ENVIRON_RESET", prot);
|
||||
SPC_Free_Protocol_Ptr(prot);
|
||||
|
@ -1342,7 +1342,7 @@ XeString *sscan_counted_string(XeString buf,
|
|||
len=strlen(bufptr)+1; /* len is string SIZE (with room for NULL) */
|
||||
*tmpidx=(XeString)XeMalloc(len);
|
||||
strncpy(*tmpidx, bufptr, len);
|
||||
(*tmpidx)[len-1]=NULL;
|
||||
(*tmpidx)[len-1]='\0';
|
||||
bufptr+= len;
|
||||
}
|
||||
*tmpidx=NULL;
|
||||
|
|
|
@ -51,12 +51,12 @@ Wire *get_new_wire(void)
|
|||
Wire *tmp_wire;
|
||||
|
||||
tmp_wire=(Wire *)XeMalloc(sizeof(Wire));
|
||||
memset(tmp_wire, NULL, sizeof(Wire));
|
||||
memset(tmp_wire, 0, sizeof(Wire));
|
||||
|
||||
tmp_wire->master_name=(XeString)XeMalloc(PTY_NAMLEN);
|
||||
memset(tmp_wire->master_name, NULL, PTY_NAMLEN);
|
||||
memset(tmp_wire->master_name, 0, PTY_NAMLEN);
|
||||
tmp_wire->slave_name =(XeString)XeMalloc(PTY_NAMLEN);
|
||||
memset(tmp_wire->slave_name, NULL, PTY_NAMLEN);
|
||||
memset(tmp_wire->slave_name, 0, PTY_NAMLEN);
|
||||
tmp_wire->fd[0] = tmp_wire->fd[1] = (-1);
|
||||
tmp_wire->read_toolkit_id = (-1);
|
||||
tmp_wire->except_toolkit_id = (-1);
|
||||
|
@ -114,7 +114,7 @@ spc_dup2(int from, int to)
|
|||
int retval;
|
||||
|
||||
/* Dup file descriptors. If a null descriptor, then use /dev/null */
|
||||
static int devnull = NULL;
|
||||
static int devnull = 0;
|
||||
|
||||
if (from == to)
|
||||
return(TRUE);
|
||||
|
@ -155,7 +155,7 @@ XeString *Alloc_Argv(int n)
|
|||
av = (XeString *)XeMalloc((n + 1) * sizeof(XeString));
|
||||
|
||||
/* Zero the space so we don't have to worry about trailing NULL */
|
||||
memset((XeString) av, NULL, (n + 1) * sizeof(XeString));
|
||||
memset((XeString) av, 0, (n + 1) * sizeof(XeString));
|
||||
|
||||
return(av);
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ Boolean _path_search (XeString path, XeString filename, path_search_predicate p)
|
|||
if(next_colon) { /* found colon */
|
||||
path_component_len = next_colon-path_rest;
|
||||
strncpy(buffer, path_rest, path_component_len);
|
||||
buffer[path_component_len]=NULL;
|
||||
buffer[path_component_len]='\0';
|
||||
path_rest=next_colon+1;
|
||||
if(!*path_rest)
|
||||
/* We've seen a ':' at the end of the string. Make path_rest be "."
|
||||
|
@ -281,7 +281,7 @@ Boolean _path_search (XeString path, XeString filename, path_search_predicate p)
|
|||
|
||||
if(!buffer[0]) {
|
||||
buffer[0] = '.';
|
||||
buffer[1] = NULL;
|
||||
buffer[1] = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -71,7 +71,7 @@ static int SPC_AddInput(int source,
|
|||
if (SPC_Fd_Mapping == NULL) {
|
||||
SPC_Fd_Mapping = (SPC_Callback_Struct **)
|
||||
XeMalloc (FD_SETSIZE * sizeof (SPC_Callback_Struct *));
|
||||
memset(SPC_Fd_Mapping, NULL, FD_SETSIZE * sizeof(SPC_Callback_Struct *));
|
||||
memset(SPC_Fd_Mapping, 0, FD_SETSIZE * sizeof(SPC_Callback_Struct *));
|
||||
}
|
||||
structptr=SPC_LOOKUP_FD_MAPPING(source);
|
||||
|
||||
|
@ -112,7 +112,7 @@ static SbInputId SPC_RemoveInput(int source,
|
|||
if (SPC_Fd_Mapping == NULL) {
|
||||
SPC_Fd_Mapping = (SPC_Callback_Struct **)
|
||||
XeMalloc (FD_SETSIZE * sizeof (SPC_Callback_Struct *));
|
||||
memset(SPC_Fd_Mapping, NULL, FD_SETSIZE * sizeof(SPC_Callback_Struct *));
|
||||
memset(SPC_Fd_Mapping, 0, FD_SETSIZE * sizeof(SPC_Callback_Struct *));
|
||||
}
|
||||
structptr=SPC_LOOKUP_FD_MAPPING(source);
|
||||
_DtSvcProcessUnlock();
|
||||
|
@ -129,7 +129,7 @@ static SbInputId SPC_RemoveInput(int source,
|
|||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------+*/
|
||||
|
|
|
@ -1472,11 +1472,11 @@ CreateInvocationRecord(
|
|||
*/
|
||||
return NULL;
|
||||
}
|
||||
myassert(invp->id != NULL );
|
||||
myassert(invp->id != 0);
|
||||
|
||||
SET_INV_PENDING(invp->state);
|
||||
invp->w = w;
|
||||
invp->numChildren = NULL;
|
||||
invp->numChildren = 0;
|
||||
invp->childRec = NULL;
|
||||
|
||||
/*
|
||||
|
@ -4802,7 +4802,7 @@ InitiateCommandInvokerRequest(
|
|||
CallbackData *data=(CallbackData *)XtMalloc((Cardinal)sizeof(CallbackData));
|
||||
ActionPtr action = request->clonedAction;
|
||||
|
||||
tmpFileBuf[0]=NULL; /* seed the buffer with a null string */
|
||||
tmpFileBuf[0]='\0'; /* seed the buffer with a null string */
|
||||
|
||||
/*
|
||||
* Generate the procId option string for dtexec
|
||||
|
@ -4833,9 +4833,9 @@ InitiateCommandInvokerRequest(
|
|||
/*
|
||||
* The string generated for procId should never exceed the procId buf size.
|
||||
*/
|
||||
sprintf(procIdBuf,"%s_%d_%d",
|
||||
sprintf(procIdBuf,"%s_%d_%lu",
|
||||
_DtActNULL_GUARD(procId),
|
||||
request->invocId,
|
||||
(int) request->invocId,
|
||||
request->childId );
|
||||
|
||||
myassert( strlen(procIdBuf) < sizeof(procIdBuf) );
|
||||
|
@ -5309,7 +5309,7 @@ _DtActMapFileName(
|
|||
* Create the full path name relative to curHost
|
||||
*/
|
||||
|
||||
buf[0]=NULL; /* empty string to start with */
|
||||
buf[0]='\0'; /* empty string to start with */
|
||||
|
||||
if ( dir )
|
||||
strcpy(buf,dir);
|
||||
|
@ -5326,7 +5326,7 @@ _DtActMapFileName(
|
|||
}
|
||||
|
||||
/* We should have constructed a file name string now */
|
||||
myassert(buf[0] != NULL);
|
||||
myassert(buf[0] != '\0');
|
||||
|
||||
if (newHost)
|
||||
{
|
||||
|
|
|
@ -210,7 +210,7 @@ Meaningless for actions -- ignore these for now
|
|||
_DtACTION_DT_NGROUP, _ActDb_DT_NGROUP_SET,
|
||||
_DtPFX _DtACTION_DTN_VALUE, _ActDb_DT_ARGN_VAL_SET,
|
||||
#endif /* _DT_ALLOW_DT_MSGS */
|
||||
NULL, NULL
|
||||
NULL, 0
|
||||
};
|
||||
|
||||
#define NUM_FIELD_NAMES sizeof(_DtActNamesAndBits)/sizeof(_DtActNameAndBit) - 1
|
||||
|
@ -235,7 +235,7 @@ _DtActFieldBitLookup(char *name)
|
|||
#endif /* _DT_ALLOW_DT_MSGS */
|
||||
|
||||
if ( !np )
|
||||
return NULL;
|
||||
return 0;
|
||||
/*
|
||||
* Check for [DT]T_ARGn_ fields
|
||||
* The following code assumes that a unique suffix identifying each
|
||||
|
@ -267,7 +267,7 @@ _DtActFieldBitLookup(char *name)
|
|||
#endif /* _DT_ALLOW_DT_MSGS */
|
||||
|
||||
if ( !np )
|
||||
return NULL;
|
||||
return 0;
|
||||
|
||||
for ( j = 0; j < NUM_FIELD_NAMES; j++ )
|
||||
if ( !strcmp(_DtActNamesAndBits[j].name,np) )
|
||||
|
@ -397,7 +397,7 @@ _DtActValidateFieldValue( long bit, char *value, char *actName, char *filename)
|
|||
/*
|
||||
* temporarily truncate string for testing
|
||||
*/
|
||||
*p = NULL;
|
||||
*p = '\0';
|
||||
if ( strcmp(_DtACT_ANY,start) &&
|
||||
strcmp(_DtACTION_FILE,start) &&
|
||||
strcmp(_DtACTION_BUFFER,start) )
|
||||
|
@ -540,7 +540,7 @@ _DtActValidateFieldValue( long bit, char *value, char *actName, char *filename)
|
|||
return (char *) -1;
|
||||
}
|
||||
}
|
||||
if (*p == NULL)
|
||||
if (*p == '\0')
|
||||
{
|
||||
/* looks like an error */
|
||||
buf = malloc(_DtAct_MAX_BUF_SIZE);
|
||||
|
@ -1028,7 +1028,7 @@ _DtActionConverter(DtDtsDbField * fields,
|
|||
_DtSvcProcessUnlock();
|
||||
return(True);
|
||||
}
|
||||
else if ( fields[1].fieldName == NULL)
|
||||
else if ( fields[1].fieldName == 0)
|
||||
{
|
||||
/* The record contains no fields */
|
||||
buf = XtMalloc(_DtAct_MAX_BUF_SIZE);
|
||||
|
@ -1060,7 +1060,7 @@ _DtActionConverter(DtDtsDbField * fields,
|
|||
|
||||
/* find the corresponding field entry and bitmask */
|
||||
|
||||
if ((ThisBit = _DtActFieldBitLookup(XrmQuarkToString(fields[i].fieldName))) != NULL)
|
||||
if ((ThisBit = _DtActFieldBitLookup(XrmQuarkToString(fields[i].fieldName))) != 0)
|
||||
{
|
||||
switch ((int)(fieldVal=_DtActValidateFieldValue(ThisBit,
|
||||
fields[i].fieldValue, fields[0].fieldValue,
|
||||
|
|
|
@ -1130,8 +1130,8 @@ _DtActionGetRecordWeight(
|
|||
static unsigned long
|
||||
_DtActMMParseArgTypesList(char *tlist, DtShmBoson **quarkAddr, int *countp)
|
||||
{
|
||||
static DtShmBoson quark_for_wild_char = NULL;
|
||||
unsigned long mask = NULL;
|
||||
static DtShmBoson quark_for_wild_char = 0;
|
||||
unsigned long mask = 0;
|
||||
int tcount;
|
||||
DtShmBoson *qp;
|
||||
char **typeVec, **tvp;
|
||||
|
@ -1182,7 +1182,7 @@ _DtActMMParseClassList(char *clist)
|
|||
char buf[_DtAct_MAX_BUF_SIZE];
|
||||
char *bp;
|
||||
char **classVec, **cvp;
|
||||
unsigned long mask = NULL;
|
||||
unsigned long mask = 0;
|
||||
|
||||
if ( !DtStrchr(clist, _DtACT_LIST_SEPARATOR_CHAR ) )
|
||||
{
|
||||
|
@ -1236,7 +1236,7 @@ _DtActMMParseClassList(char *clist)
|
|||
static unsigned long
|
||||
_DtActMMParseArgCountString( char *countStr, int *countp)
|
||||
{
|
||||
unsigned long mask = NULL;
|
||||
unsigned long mask = 0;
|
||||
|
||||
if ( !strcmp(countStr,_DtACT_ANY) )
|
||||
return SET_ARG_COUNT_WILD(mask);
|
||||
|
@ -1258,7 +1258,7 @@ _DtActMMParseArgCountString( char *countStr, int *countp)
|
|||
static unsigned long
|
||||
_DtActMMParseActionType(char *actionTypeStr)
|
||||
{
|
||||
unsigned long mask = NULL;
|
||||
unsigned long mask = 0;
|
||||
|
||||
if ( !strcmp(actionTypeStr,_DtACTION_COMMAND) )
|
||||
return SET_CMD_ACTION(mask);
|
||||
|
|
|
@ -111,7 +111,7 @@ _DtBasename( const char *s )
|
|||
return NULL;
|
||||
|
||||
/* Work on a local copy of the original string */
|
||||
*p = NULL;
|
||||
*p = '\0';
|
||||
(void)strcpy(p,s);
|
||||
|
||||
#ifdef _Dt_HOST_COLON_PATH_SUPPORT
|
||||
|
@ -140,7 +140,7 @@ _DtBasename( const char *s )
|
|||
myassert( *basep == '/');
|
||||
if ( basep == p )
|
||||
return XtNewString(basep);
|
||||
*basep = NULL; /* replace trailing slash */
|
||||
*basep = '\0'; /* replace trailing slash */
|
||||
if ( (basep = DtStrrchr(p,'/')) == NULL )
|
||||
return XtNewString(p);
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ _DtDirname( const char *s)
|
|||
|
||||
|
||||
/* Work on a local copy of the original string */
|
||||
*p = NULL;
|
||||
*p = '\0';
|
||||
(void)strcpy(p,s);
|
||||
|
||||
#ifdef _Dt_HOST_COLON_PATH_SUPPORT
|
||||
|
@ -231,7 +231,7 @@ _DtDirname( const char *s)
|
|||
* -- then try again else break
|
||||
*/
|
||||
if ( slashp == DtPrevChar(p,p + strlen(p)) )
|
||||
*slashp = NULL;
|
||||
*slashp = '\0';
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ _DtDirname( const char *s)
|
|||
* directory name.
|
||||
*/
|
||||
dirp = XtNewString(p);
|
||||
*(dirp + (slashp - p)) = NULL;
|
||||
*(dirp + (slashp - p)) = '\0';
|
||||
return dirp;
|
||||
}
|
||||
|
||||
|
@ -283,14 +283,14 @@ _DtHostString( const char *s)
|
|||
* Make a local copy of the string to avoid problems modifying
|
||||
* "const" strings.
|
||||
*/
|
||||
*p = NULL;
|
||||
*p = '\0';
|
||||
(void) strcpy(p,s);
|
||||
|
||||
/* if ( (slashp > s) && (*(slashp -1) == ':' )) */
|
||||
if ( (slashp > s) && (*DtPrevChar(s,slashp) == ':' ))
|
||||
{
|
||||
/* *(p + (slashp - s - 1)) = NULL; */
|
||||
*(p + (DtPrevChar(s,slashp) - s)) = NULL;
|
||||
*(p + (DtPrevChar(s,slashp) - s)) = '\0';
|
||||
host = XtNewString(p);
|
||||
return host;
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ _DtGetDisplayHostName( Display *dp)
|
|||
}
|
||||
|
||||
tmpName = XtMalloc(MAXHOSTNAMELEN + 5);
|
||||
tmpName[0] = NULL;
|
||||
tmpName[0] = '\0';
|
||||
|
||||
if ( dp )
|
||||
{
|
||||
|
@ -356,7 +356,7 @@ _DtGetDisplayHostName( Display *dp)
|
|||
strcpy(tmpName,DisplayString(dp));
|
||||
if ( tmp = DtStrrchr(tmpName,':') )
|
||||
{
|
||||
*tmp = NULL;
|
||||
*tmp = '\0';
|
||||
displayHostName = XtNewString(tmpName);
|
||||
}
|
||||
}
|
||||
|
@ -370,7 +370,7 @@ _DtGetDisplayHostName( Display *dp)
|
|||
strcpy(tmpName,getenv("DISPLAY"));
|
||||
if ( tmp = DtStrrchr(tmpName,':') )
|
||||
{
|
||||
*tmp = NULL;
|
||||
*tmp = '\0';
|
||||
displayHostName = XtNewString(tmpName);
|
||||
}
|
||||
}
|
||||
|
@ -424,7 +424,7 @@ _DtGetLocalHostName( void )
|
|||
return NULL; /* failed gethostname */
|
||||
}
|
||||
if (ptr = DtStrchr(hostNameBuf, '.'))
|
||||
*ptr = NULL; /* delete domain name if there is one */
|
||||
*ptr = '\0'; /* delete domain name if there is one */
|
||||
|
||||
localHostName = hostNameBuf;
|
||||
_DtSvcProcessUnlock();
|
||||
|
@ -481,9 +481,9 @@ _DtIsSameHost(const char *host1, const char *host2)
|
|||
* to their short form before doing the compare.
|
||||
*/
|
||||
if ( (tp = DtStrchr(hostName1,'.')) != NULL )
|
||||
*tp = NULL;
|
||||
*tp = '\0';
|
||||
if ( (tp = DtStrchr(hostName2,'.')) != NULL )
|
||||
*tp = NULL;
|
||||
*tp = '\0';
|
||||
|
||||
/*
|
||||
* Try to avoid querying the name server (or /etc/hosts).
|
||||
|
@ -502,7 +502,7 @@ _DtIsSameHost(const char *host1, const char *host2)
|
|||
*/
|
||||
strcpy(hostName1, host_ret->h_name);
|
||||
if ( (tp = DtStrchr(hostName1,'.')) != NULL )
|
||||
*tp = NULL;
|
||||
*tp = '\0';
|
||||
|
||||
/*
|
||||
* Try comparing again -- avoiding another gethostbyname
|
||||
|
@ -838,7 +838,7 @@ _DtActGenerateTmpFile(char *dir,char *format,mode_t mode,int *fd)
|
|||
* of the tmp file name (i.e. no %s in format) then
|
||||
* there is no sense trying more than once.
|
||||
*/
|
||||
if ( countTrys > 0 && (strcmp(f,nameBuf) == NULL))
|
||||
if ( countTrys > 0 && (strcmp(f,nameBuf) == 0))
|
||||
return NULL;
|
||||
|
||||
base = XtNewString(nameBuf);
|
||||
|
@ -892,7 +892,7 @@ _DtRemoveTrailingBlanksInPlace(char **s)
|
|||
for ( p = DtPrevChar(*s,*s + strlen(*s));
|
||||
DtIsspace(p) && (p > *s);
|
||||
p=DtPrevChar(*s,p))
|
||||
*p = NULL;
|
||||
*p = '\0';
|
||||
|
||||
}
|
||||
|
||||
|
@ -1245,7 +1245,7 @@ int _DtActDeleteInvRec( DtActionInvocationID id )
|
|||
|
||||
if (IS_BUFFER_OBJ(infop->mask) && IS_FILE_OBJ(infop->mask))
|
||||
{
|
||||
myassert((infop->name!=NULL) && (*infop->name!=NULL));
|
||||
myassert((infop->name != NULL) && (*infop->name != '\0'));
|
||||
if ( !infop->name )
|
||||
continue;
|
||||
/*
|
||||
|
@ -1317,7 +1317,7 @@ _DtActChildRecT *_DtActAllocChildRec( _DtActInvRecT *invRec )
|
|||
|
||||
tchildRec = invRec->childRec[invRec->numChildren - 1]; /* shorthand */
|
||||
|
||||
memset(tchildRec, NULL, sizeof(_DtActChildRecT));
|
||||
memset(tchildRec, 0, sizeof(_DtActChildRecT));
|
||||
tchildRec->childId = invRec->numChildren; /* serial # of sorts */
|
||||
|
||||
/* tchildRec->u.* = initialized elsewhere */
|
||||
|
@ -1837,7 +1837,7 @@ _DtActReadTmpFileToBuffer( char *fname, int *sizep )
|
|||
|
||||
buf = (char *) XtMalloc(MAX_BUF_SIZE);
|
||||
for (size=0, space=MAX_BUF_SIZE;
|
||||
(bytes=read(fd,buf+size,space)) != NULL;
|
||||
(bytes=read(fd,buf+size,space)) != 0;
|
||||
size += bytes )
|
||||
{
|
||||
if ( bytes < 0 )
|
||||
|
|
|
@ -578,7 +578,7 @@ ExecuteQueuedRequest (
|
|||
strlen (pNode->exec_host) +
|
||||
cmdlen + 4);
|
||||
cmdp = (char *) XtMalloc(cmdlen + 1);
|
||||
*cmdp = NULL;
|
||||
*cmdp = '\0';
|
||||
for (i = 0; pNode->argv[i]; i++) {
|
||||
strcat(cmdp,pNode->argv[i]);
|
||||
strcat(cmdp, " ");
|
||||
|
@ -1177,7 +1177,7 @@ DtCmdGetWindowType(
|
|||
switch ( windowTypeMask )
|
||||
{
|
||||
case _DtAct_NO_STDIO_BIT:
|
||||
winTypeNum = NULL;
|
||||
winTypeNum = 0;
|
||||
break;
|
||||
case _DtAct_TERMINAL_BIT:
|
||||
winTypeNum = TERMINAL;
|
||||
|
|
|
@ -1712,7 +1712,7 @@ SplitField(
|
|||
*NumberFieldsAllocated += NUMBER_FIELDS_INCREMENT;
|
||||
}
|
||||
|
||||
(*fields)[*slotToUse].fieldName = NULL;
|
||||
(*fields)[*slotToUse].fieldName = 0;
|
||||
(*fields)[*slotToUse].fieldValue = NULL;
|
||||
|
||||
/* A NULL ptr is how we force a NULL entry to terminate the array */
|
||||
|
|
|
@ -998,7 +998,7 @@ dndGetContextXID(
|
|||
static XID contextXID;
|
||||
|
||||
_DtSvcProcessLock();
|
||||
if (contextXID == NULL) {
|
||||
if (contextXID == 0) {
|
||||
contextXID = XCreatePixmap(display,
|
||||
DefaultRootWindow(display), 1, 1, 1);
|
||||
}
|
||||
|
|
|
@ -712,7 +712,7 @@ get_buff(type_info_t *info)
|
|||
if((info->buffer = mmap(NULL,
|
||||
buf->st_size,
|
||||
PROT_READ, MAP_PRIVATE,
|
||||
info->file_fd, NULL)) == (char *)-1)
|
||||
info->file_fd, 0)) == (char *)-1)
|
||||
{
|
||||
info->mmap_size_to_free = -1;
|
||||
info->size_to_free = buf->st_size+1;
|
||||
|
|
|
@ -609,7 +609,7 @@ _DtDtsMMapDB(const char *CacheFile)
|
|||
MAP_SHARED,
|
||||
#endif
|
||||
mmaped_fd,
|
||||
NULL);
|
||||
0);
|
||||
if(mmaped_db != (void *) -1)
|
||||
{
|
||||
success = TRUE;
|
||||
|
|
|
@ -115,7 +115,7 @@ _GetMwmWindow(
|
|||
Window wroot, wparent, *pchildren;
|
||||
unsigned int nchildren;
|
||||
|
||||
*pMwmWindow = NULL;
|
||||
*pMwmWindow = 0;
|
||||
if ((rcode=XGetWindowProperty(display,root,
|
||||
property,0L, PROP_MWM_INFO_ELEMENTS,
|
||||
False,property,
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
************************************<+>*************************************/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*********************************************************************
|
||||
* _DtQualifyWithFirst
|
||||
|
|
|
@ -843,7 +843,7 @@ _GetSmWindow(
|
|||
Window wroot, wparent, *pchildren;
|
||||
unsigned int nchildren;
|
||||
|
||||
*pSmWindow = NULL;
|
||||
*pSmWindow = 0;
|
||||
if ((rcode=XGetWindowProperty(display,root,
|
||||
property,0L, PROP_DT_SM_WINDOW_INFO_ELEMENTS,
|
||||
False,property,
|
||||
|
@ -938,8 +938,8 @@ static struct {
|
|||
char *string;
|
||||
Atom atom;
|
||||
} smAtomList[] = {
|
||||
{_XA_DT_SM_STATE_INFO, NULL},
|
||||
{_XA_DT_SM_SAVER_INFO, NULL},
|
||||
{_XA_DT_SM_STATE_INFO, 0},
|
||||
{_XA_DT_SM_SAVER_INFO, 0},
|
||||
};
|
||||
|
||||
static Atom
|
||||
|
|
|
@ -170,7 +170,7 @@ _DtShmProtoAddStrtab(DtShmProtoStrtab strlist, const char * string, int * isnew)
|
|||
|
||||
int ret = *bucket;
|
||||
|
||||
if(*bucket == NULL) /* new */ {
|
||||
if(*bucket == 0) /* new */ {
|
||||
unsigned char ** sptr;
|
||||
*isnew = 1;
|
||||
*bucket = ret = ptr->sl_charcount;
|
||||
|
|
|
@ -443,7 +443,7 @@ _DtEnvControl(
|
|||
* then put our dt string just ahead of
|
||||
* "/usr/bin/X11" in the new PATH
|
||||
*/
|
||||
*(ptr - 1) = NULL;
|
||||
*(ptr - 1) = '\0';
|
||||
sprintf(_postDtEnvironment.binPath,
|
||||
"%s=%s:%s:%s",
|
||||
BIN_PATH_ENVIRON,
|
||||
|
@ -479,7 +479,7 @@ _DtEnvControl(
|
|||
* "/usr/bin" in the new PATH
|
||||
*/
|
||||
|
||||
*(ptr - 1) = NULL;
|
||||
*(ptr - 1) = '\0';
|
||||
sprintf(_postDtEnvironment.binPath,
|
||||
"%s=%s:%s:%s",
|
||||
BIN_PATH_ENVIRON,
|
||||
|
|
|
@ -265,7 +265,7 @@ GetShortHostname(
|
|||
if (status = gethostname(buffer, bufsize))
|
||||
return status; /* failed gethostname */
|
||||
if (ptr = strstr(buffer, (char *)"."))
|
||||
*ptr = NULL; /* delete domain name if there is one */
|
||||
*ptr = '\0'; /* delete domain name if there is one */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -259,7 +259,7 @@ char * ExpandPath (
|
|||
/*** otherwise, make it relative to the current directory ***/
|
||||
|
||||
/* get user's current working directory */
|
||||
if (getcwd(tmpPath, MAXPATHLEN) == NULL) return NULL; /* RETURN: error */
|
||||
if (getcwd(tmpPath, MAXPATHLEN) == 0) return NULL; /* RETURN: error */
|
||||
|
||||
/*** add a slash to end of path component, if needed ***/
|
||||
/* get end of the string */
|
||||
|
|
|
@ -564,7 +564,7 @@ _DtAddResString(
|
|||
int actualFormat;
|
||||
unsigned long nitems, leftover;
|
||||
|
||||
if((data == NULL) || (*data == NULL))
|
||||
if((data == NULL) || (*data == '\0'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue