1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtimsstart: Coverity fixes

This commit is contained in:
Peter Howkins 2018-04-28 21:44:27 +01:00
parent 55c120b287
commit 62ee95bce2
7 changed files with 15 additions and 19 deletions

View file

@ -270,10 +270,11 @@ int make_new_environ(oenv, sel)
xmod_done = False; xmod_done = False;
# ifdef old_hpux # ifdef old_hpux
xinput = xhp_xinput_name(NULL); xinput = xhp_xinput_name(NULL);
xinput_done = (xinput) ? False : True;
# else # else
xinput = NULL; xinput = NULL;
xinput_done = True;
# endif /* old_hpux */ # endif /* old_hpux */
xinput_done = (xinput) ? False : True;
proto = renv ? renv->proto : default_protocol(ims); proto = renv ? renv->proto : default_protocol(ims);
setp = unsetp = 0; setp = unsetp = 0;

View file

@ -166,7 +166,7 @@ int read_cmd_conf()
if (!(path = getenv("DTIMS_STARTCONF")) || !*path) { if (!(path = getenv("DTIMS_STARTCONF")) || !*path) {
if ((p = getenv("DTIMS_CONFDIR")) && *p) if ((p = getenv("DTIMS_CONFDIR")) && *p)
conf_dir = p; conf_dir = p;
sprintf(path = buf, "%s/%s", conf_dir, DTIMS_CONFFILE); snprintf(path = buf, sizeof(buf), "%s/%s", conf_dir, DTIMS_CONFFILE);
} }
} }
DPR3(("read_cmd_conf(): path=%s\n", path)); DPR3(("read_cmd_conf(): path=%s\n", path));

View file

@ -662,7 +662,7 @@ static int set_locale_env(locale)
env_name = "LANG"; env_name = "LANG";
env_value = getenv(env_name); env_value = getenv(env_name);
if (env_value) if (env_value)
strcpy(buf, env_value); snprintf(buf, sizeof(buf), "%s", env_value);
if (locale && *locale) { if (locale && *locale) {
if (!*buf || strcmp(locale, buf)) { if (!*buf || strcmp(locale, buf)) {
bp = strcpyx(buf, env_name); *bp++ = '='; bp = strcpyx(buf, env_name); *bp++ = '=';
@ -679,7 +679,7 @@ static int set_locale_env(locale)
env_name = "LC_ALL"; env_name = "LC_ALL";
env_value = getenv(env_name); env_value = getenv(env_name);
if (env_value) if (env_value)
strcpy(buf2, env_value); snprintf(buf2, sizeof(buf2), "%s", env_value);
if (!*buf2 || strcmp(locale, buf2)) { if (!*buf2 || strcmp(locale, buf2)) {
bp = strcpyx(buf2, env_name); *bp++ = '='; bp = strcpyx(buf2, env_name); *bp++ = '=';
strcpyx(bp, locale); strcpyx(bp, locale);

View file

@ -624,18 +624,11 @@ int exec_remote_ims(sel)
if (ret != NoError) return ret; if (ret != NoError) return ret;
if (ret == NoError) { ac = 0;
ac = 0; av = NULL; av = NULL;
ret = get_window_data(&ac, &av); ret = get_window_data(&ac, &av);
ret = NoError; put_xims_log("'%s' started for %s on %s.",
sel->name, userEnv.displayname, sel->hostname);
if (ret != NoError) return ret;
}
if (ret == NoError) {
put_xims_log("'%s' started for %s on %s.",
sel->name, userEnv.displayname, sel->hostname);
}
DPR2(("exec_remote_ims(): ret=%s[%d]\n", error_name(ret), ret)); DPR2(("exec_remote_ims(): ret=%s[%d]\n", error_name(ret), ret));

View file

@ -260,7 +260,7 @@ bool parse_dpy_str(display_str, host, dnum, snum, dnet)
char buf[BUFSIZ], hostbuf[BUFSIZ], *p, *hp, *pdnum, *psnum; char buf[BUFSIZ], hostbuf[BUFSIZ], *p, *hp, *pdnum, *psnum;
int isdnet = 0; int isdnet = 0;
strcpy(buf, display_str); snprintf(buf, sizeof(buf), "%s", display_str);
/* extract host name */ /* extract host name */
if (!(p = strchr(buf, ':'))) return False; if (!(p = strchr(buf, ':'))) return False;

View file

@ -545,6 +545,7 @@ int start_selection_window()
XtRealizeWidget(TopW); XtRealizeWidget(TopW);
XtAppMainLoop(appC); XtAppMainLoop(appC);
/* not reached */ /* not reached */
return NoError;
} }
static void finish_selection_window(end_window) static void finish_selection_window(end_window)
@ -1259,6 +1260,7 @@ int start_mode_window(cur_mode)
XtAppMainLoop(appC); XtAppMainLoop(appC);
/* not rearched */ /* not rearched */
return NoError;
} }
static void finish_mode_window(end_window) static void finish_mode_window(end_window)
@ -1641,7 +1643,7 @@ int put_msg_win(type, msg)
WaitingDialogReply = True; WaitingDialogReply = True;
} }
return reply == XmCR_OK ? True : False; return reply = XmCR_OK ? True : False;
} }

View file

@ -110,7 +110,7 @@ Extern char *errFuncName;
#define setErrArg1(arg) _setErrArg(0, arg) #define setErrArg1(arg) _setErrArg(0, arg)
#define setErrArg2(arg) _setErrArg(1, arg) #define setErrArg2(arg) _setErrArg(1, arg)
#define setErrArg3(arg) _setErrArg(2, arg) #define setErrArg3(arg) _setErrArg(2, arg)
#define setErrFile(path) strcpy(errFilePath, (path)) #define setErrFile(path) snprintf(errFilePath, sizeof(errFilePath), "%s", (path))
#define setErrFunc(name) errFuncName = (name) #define setErrFunc(name) errFuncName = (name)
#undef Extern #undef Extern