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;
# ifdef old_hpux
xinput = xhp_xinput_name(NULL);
xinput_done = (xinput) ? False : True;
# else
xinput = NULL;
xinput_done = True;
# endif /* old_hpux */
xinput_done = (xinput) ? False : True;
proto = renv ? renv->proto : default_protocol(ims);
setp = unsetp = 0;

View file

@ -166,7 +166,7 @@ int read_cmd_conf()
if (!(path = getenv("DTIMS_STARTCONF")) || !*path) {
if ((p = getenv("DTIMS_CONFDIR")) && *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));

View file

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

View file

@ -624,18 +624,11 @@ int exec_remote_ims(sel)
if (ret != NoError) return ret;
if (ret == NoError) {
ac = 0; av = NULL;
ret = get_window_data(&ac, &av);
ret = NoError;
if (ret != NoError) return ret;
}
if (ret == NoError) {
put_xims_log("'%s' started for %s on %s.",
sel->name, userEnv.displayname, sel->hostname);
}
ac = 0;
av = NULL;
ret = get_window_data(&ac, &av);
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));

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;
int isdnet = 0;
strcpy(buf, display_str);
snprintf(buf, sizeof(buf), "%s", display_str);
/* extract host name */
if (!(p = strchr(buf, ':'))) return False;

View file

@ -545,6 +545,7 @@ int start_selection_window()
XtRealizeWidget(TopW);
XtAppMainLoop(appC);
/* not reached */
return NoError;
}
static void finish_selection_window(end_window)
@ -1259,6 +1260,7 @@ int start_mode_window(cur_mode)
XtAppMainLoop(appC);
/* not rearched */
return NoError;
}
static void finish_mode_window(end_window)
@ -1641,7 +1643,7 @@ int put_msg_win(type, msg)
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 setErrArg2(arg) _setErrArg(1, 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)
#undef Extern