mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
libDtWidget: Resolve some Coverity warnings
This commit is contained in:
parent
edd928caf5
commit
73b6311a83
5 changed files with 15 additions and 27 deletions
|
@ -2085,7 +2085,7 @@ ReplaceJPDate(char *date, char *jpstr, int wday)
|
||||||
free(s);
|
free(s);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
strcpy(abday, nl_langinfo(ABDAY_1 + wday));
|
snprintf(abday, sizeof(abday), "%s", nl_langinfo(ABDAY_1 + wday));
|
||||||
if((rp = strstr(date, abday)) != NULL) {
|
if((rp = strstr(date, abday)) != NULL) {
|
||||||
for(i = 0, j = 0, sp = date; date[j] != '\0'; sp++) {
|
for(i = 0, j = 0, sp = date; date[j] != '\0'; sp++) {
|
||||||
if(sp == rp) {
|
if(sp == rp) {
|
||||||
|
|
|
@ -304,7 +304,6 @@ SetUndoDeletionState(
|
||||||
strcat(M_deletedText(pPriv), oldUndo);
|
strcat(M_deletedText(pPriv), oldUndo);
|
||||||
M_deletionStart(pPriv) = cb->startPos;
|
M_deletionStart(pPriv) = cb->startPos;
|
||||||
}
|
}
|
||||||
if(oldUndo != (char *)NULL)
|
|
||||||
XtFree(oldUndo);
|
XtFree(oldUndo);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -323,7 +322,6 @@ SetUndoDeletionState(
|
||||||
M_insertionLength(pPriv) = 0;
|
M_insertionLength(pPriv) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pDeletedText != (char *)NULL )
|
|
||||||
XtFree( pDeletedText );
|
XtFree( pDeletedText );
|
||||||
} /* SetUndoDeletionState */
|
} /* SetUndoDeletionState */
|
||||||
|
|
||||||
|
|
|
@ -961,7 +961,7 @@ Initialize(
|
||||||
PopupCallback, (XtPointer)new_w);
|
PopupCallback, (XtPointer)new_w);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name) XtFree(name);
|
XtFree(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -482,7 +482,6 @@ SearchForString(
|
||||||
return (int)pos;
|
return (int)pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (word != (char *)NULL)
|
|
||||||
XtFree(word);
|
XtFree(word);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -812,7 +811,6 @@ _DtEditorDialogSearchCB(
|
||||||
* Find/Change mode
|
* Find/Change mode
|
||||||
* Free the existing search string and get the new one.
|
* Free the existing search string and get the new one.
|
||||||
*/
|
*/
|
||||||
if (M_search_string(pPriv))
|
|
||||||
XtFree(M_search_string(pPriv));
|
XtFree(M_search_string(pPriv));
|
||||||
M_search_string(pPriv) = XmTextFieldGetString( M_findText(pPriv) );
|
M_search_string(pPriv) = XmTextFieldGetString( M_findText(pPriv) );
|
||||||
|
|
||||||
|
@ -869,7 +867,6 @@ _DtEditorDialogSearchCB(
|
||||||
if( pString != (char *)NULL && *pString != (char)'\0' )
|
if( pString != (char *)NULL && *pString != (char)'\0' )
|
||||||
_DtEditorSetReplaceSensitivity( pPriv, True );
|
_DtEditorSetReplaceSensitivity( pPriv, True );
|
||||||
|
|
||||||
if(pString != (char *)NULL)
|
|
||||||
XtFree(pString);
|
XtFree(pString);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -918,7 +915,6 @@ _DtEditorDialogReplaceCB(
|
||||||
* Find/Change mode
|
* Find/Change mode
|
||||||
* Free the existing Change To string and get the new one.
|
* Free the existing Change To string and get the new one.
|
||||||
*/
|
*/
|
||||||
if (M_replace_string(pPriv))
|
|
||||||
XtFree(M_replace_string(pPriv));
|
XtFree(M_replace_string(pPriv));
|
||||||
M_replace_string(pPriv) = XmTextFieldGetString(M_replaceText(pPriv));
|
M_replace_string(pPriv) = XmTextFieldGetString(M_replaceText(pPriv));
|
||||||
|
|
||||||
|
@ -979,14 +975,12 @@ _DtEditorDialogReplaceAllCB(
|
||||||
* Find/Change mode
|
* Find/Change mode
|
||||||
* Free any existing search string before getting the current one.
|
* Free any existing search string before getting the current one.
|
||||||
*/
|
*/
|
||||||
if (M_search_string(pPriv))
|
|
||||||
XtFree(M_search_string(pPriv));
|
XtFree(M_search_string(pPriv));
|
||||||
M_search_string(pPriv) = XmTextFieldGetString(M_findText(pPriv));
|
M_search_string(pPriv) = XmTextFieldGetString(M_findText(pPriv));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Free the existing Change To string and get the new one.
|
* Free the existing Change To string and get the new one.
|
||||||
*/
|
*/
|
||||||
if (M_replace_string(pPriv))
|
|
||||||
XtFree(M_replace_string(pPriv));
|
XtFree(M_replace_string(pPriv));
|
||||||
M_replace_string(pPriv) = XmTextFieldGetString(M_replaceText(pPriv));
|
M_replace_string(pPriv) = XmTextFieldGetString(M_replaceText(pPriv));
|
||||||
|
|
||||||
|
@ -1018,7 +1012,6 @@ _DtEditorDialogReplaceAllCB(
|
||||||
changeValues.changeTo = XmTextFieldGetString(M_replaceText(pPriv));
|
changeValues.changeTo = XmTextFieldGetString(M_replaceText(pPriv));
|
||||||
DtEditorChange((Widget)pPriv, &changeValues, DtEDITOR_ALL_OCCURRENCES);
|
DtEditorChange((Widget)pPriv, &changeValues, DtEDITOR_ALL_OCCURRENCES);
|
||||||
|
|
||||||
if( changeValues.changeTo != (char *)NULL )
|
|
||||||
XtFree( changeValues.changeTo );
|
XtFree( changeValues.changeTo );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1061,7 +1054,6 @@ _DtEditorMisspelledSelectCB(
|
||||||
* Get the selected word for use when the Find or Replace All button
|
* Get the selected word for use when the Find or Replace All button
|
||||||
* is pressed.
|
* is pressed.
|
||||||
*/
|
*/
|
||||||
if (M_misspelled_string(editor))
|
|
||||||
XtFree(M_misspelled_string(editor));
|
XtFree(M_misspelled_string(editor));
|
||||||
|
|
||||||
M_misspelled_string(editor) =
|
M_misspelled_string(editor) =
|
||||||
|
@ -1181,7 +1173,6 @@ _DtEditorFindTextChangedCB(
|
||||||
*/
|
*/
|
||||||
defaultButton = M_search_findBtn(editor);
|
defaultButton = M_search_findBtn(editor);
|
||||||
}
|
}
|
||||||
if(pString != (char *)NULL)
|
|
||||||
XtFree(pString);
|
XtFree(pString);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1247,7 +1238,6 @@ _DtEditorReplaceTextChangedCB(
|
||||||
if ( M_misspelled_found(editor) )
|
if ( M_misspelled_found(editor) )
|
||||||
_DtEditorSetReplaceSensitivity(editor, True );
|
_DtEditorSetReplaceSensitivity(editor, True );
|
||||||
|
|
||||||
if(pString != (char *)NULL)
|
|
||||||
XtFree(pString);
|
XtFree(pString);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -762,7 +762,7 @@ Redisplay(
|
||||||
|
|
||||||
/* Redisplay work area.
|
/* Redisplay work area.
|
||||||
*/
|
*/
|
||||||
if (work_area && XmIsGadget (work_area) && XtIsManaged (work_area))
|
if (XmIsGadget (work_area) && XtIsManaged (work_area))
|
||||||
{
|
{
|
||||||
XtExposeProc expose;
|
XtExposeProc expose;
|
||||||
_DtProcessLock();
|
_DtProcessLock();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue