1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtmail: Resolve uninitialized warnings

This commit is contained in:
Peter Howkins 2021-12-22 01:18:40 +00:00 committed by Jon Trulson
parent 85268b3476
commit 72b59ec869
7 changed files with 17 additions and 9 deletions

View file

@ -703,7 +703,7 @@ MenuBar::rotateLabels(
XtArgVal num_children; XtArgVal num_children;
WidgetList children; WidgetList children;
XmString label, endlabel; XmString label, endlabel;
Widget prevwid, wid; Widget prevwid = NULL, wid;
if (startindex < 0 || endindex < 0) if (startindex < 0 || endindex < 0)
return; return;
@ -763,9 +763,11 @@ MenuBar::rotateLabels(
prevwid = (Widget) children[j]; prevwid = (Widget) children[j];
} while (!XtIsManaged(prevwid)); } while (!XtIsManaged(prevwid));
XtVaGetValues(prevwid, if(prevwid) {
XmNlabelString, &label, XtVaGetValues(prevwid,
NULL); XmNlabelString, &label,
NULL);
}
XtVaSetValues(wid, XtVaSetValues(wid,
XmNlabelString, label, XmNlabelString, label,

View file

@ -2549,7 +2549,7 @@ SaveAsTextCmd::writeText(XtPointer filedes, char *text_buf)
void void
SaveAsTextCmd::doit() SaveAsTextCmd::doit()
{ {
MsgScrollingList *list; MsgScrollingList *list = NULL;
Widget listW; Widget listW;
int *pos_list = NULL; int *pos_list = NULL;
int pos_count = 0; int pos_count = 0;

View file

@ -904,6 +904,9 @@ dtb_more_help_dispatch(
*cp++ = 0; *cp++ = 0;
vol = buffer; vol = buffer;
loc = cp; loc = cp;
} else {
/* No / in help string, invalid */
return;
} }
if(GeneralHelpDialog == (Widget)NULL) { if(GeneralHelpDialog == (Widget)NULL) {
@ -2489,7 +2492,7 @@ align_labels(
) )
{ {
WidgetList children_list = NULL, WidgetList children_list = NULL,
one_col; one_col = NULL;
Widget previous_child = NULL, Widget previous_child = NULL,
child, child,
previous_ref_widget = NULL; previous_ref_widget = NULL;

View file

@ -404,7 +404,7 @@ char *
DtMailEnv::getMessageText(int set, int msg, char *dft) DtMailEnv::getMessageText(int set, int msg, char *dft)
{ {
static int oneTimeFlag = 0; // Only attempt to open message catalog once static int oneTimeFlag = 0; // Only attempt to open message catalog once
char *message; char *message = NULL;
if ((oneTimeFlag == 0) && (_errorCatalog == (nl_catd) -1)) if ((oneTimeFlag == 0) && (_errorCatalog == (nl_catd) -1))
{ {

View file

@ -108,7 +108,7 @@ getNamedValueString(const char *string, const char *name)
{ {
int stringLen = strlen(string); int stringLen = strlen(string);
int nameLen = strlen(name); int nameLen = strlen(name);
const char * results; const char * results = NULL;
char * stringEnd; char * stringEnd;
unsigned int offset; unsigned int offset;

View file

@ -420,6 +420,7 @@ RFCBodyPart::flagIsSet(DtMailEnv & error,
default: default:
error.setError(DTME_OperationInvalid); error.setError(DTME_OperationInvalid);
return(DTM_FALSE);
} }
return(answer); return(answer);

View file

@ -381,6 +381,8 @@ RFCValue::toDate(void)
const char *token_end[12]; const char *token_end[12];
int n_tokens = 0; int n_tokens = 0;
token_end[0] = NULL;
// Look for the end of each token. Date tokens are white space // Look for the end of each token. Date tokens are white space
// separated. // separated.
while (*pos) { while (*pos) {
@ -407,7 +409,7 @@ RFCValue::toDate(void)
// Some dates will have a comma after the day of the week. We // Some dates will have a comma after the day of the week. We
// want to remove that. It will always be the first token if // want to remove that. It will always be the first token if
// we have the day of the week. // we have the day of the week.
if (*token_end[0] == ',') { if (token_end[0] && *token_end[0] == ',') {
token_end[0]--; token_end[0]--;
} }