From b2db23c0af9e43c6cdf5e4207f72f3e5ce51e250 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Mon, 24 Mar 2014 15:54:43 -0600 Subject: [PATCH] cleanup: eliminate "implicit declaration" warnings. Also fixed a potential core/memory corruption in dticon. --- cde/programs/dtdocbook/lib/tptregexp/regerror.c | 1 + cde/programs/dthelp/dthelpdemo/HelpCache.c | 3 ++- cde/programs/dthelp/dthelpdemo/Main.c | 11 +++++++---- cde/programs/dthelp/dthelpprint/Main.c | 3 ++- cde/programs/dthelp/parser/canon1/util/wchar.c | 1 + cde/programs/dthelp/parser/pass2/util/wchar.c | 1 + cde/programs/dticon/event.c | 2 ++ cde/programs/dticon/fileIO.c | 5 +++-- cde/programs/dtksh/ksh93/ship/shipproto.c | 2 +- 9 files changed, 20 insertions(+), 9 deletions(-) diff --git a/cde/programs/dtdocbook/lib/tptregexp/regerror.c b/cde/programs/dtdocbook/lib/tptregexp/regerror.c index 4a688779..36af889d 100644 --- a/cde/programs/dtdocbook/lib/tptregexp/regerror.c +++ b/cde/programs/dtdocbook/lib/tptregexp/regerror.c @@ -22,6 +22,7 @@ */ /* $XConsortium: regerror.c /main/3 1996/06/19 17:13:36 drk $ */ #include +#include void tpt_regerror(s) diff --git a/cde/programs/dthelp/dthelpdemo/HelpCache.c b/cde/programs/dthelp/dthelpdemo/HelpCache.c index 76c7e8f5..0bdef5b9 100644 --- a/cde/programs/dthelp/dthelpdemo/HelpCache.c +++ b/cde/programs/dthelp/dthelpdemo/HelpCache.c @@ -43,7 +43,8 @@ ************************************<+>*************************************/ /* System Include Files */ - +#include +#include #include #include diff --git a/cde/programs/dthelp/dthelpdemo/Main.c b/cde/programs/dthelp/dthelpdemo/Main.c index 87246a8a..c5c87ccb 100644 --- a/cde/programs/dthelp/dthelpdemo/Main.c +++ b/cde/programs/dthelp/dthelpdemo/Main.c @@ -42,6 +42,9 @@ **************************************************************************** ************************************<+>*************************************/ +#include +#include + #include #include #include @@ -624,7 +627,7 @@ static void ManageButtonsCB( TurnOnHourGlass(topLevel); - switch ((int)clientData) + switch ((long)clientData) { case CREATE_SAMPLE: @@ -745,7 +748,7 @@ static void Control1ButtonsCB( TurnOnHourGlass(topLevel); - switch ((int)clientData) + switch ((long)clientData) { case CHANGE_CONTENT: @@ -881,14 +884,14 @@ static void HelpMenuCB( /* Determine which help button was activated and display the * appropriate help information */ - switch ((int)clientData) + switch ((long)clientData) { case HELP_ON_ITEM: while (!XtIsSubclass(widget, applicationShellWidgetClass)) widget = XtParent(widget); - status = DtHelpReturnSelectedWidgetId(widget, NULL, &selWidget); + status = DtHelpReturnSelectedWidgetId(widget, 0, &selWidget); switch ((int)status) { diff --git a/cde/programs/dthelp/dthelpprint/Main.c b/cde/programs/dthelp/dthelpprint/Main.c index 33f7130d..a00ef305 100644 --- a/cde/programs/dthelp/dthelpprint/Main.c +++ b/cde/programs/dthelp/dthelpprint/Main.c @@ -41,6 +41,7 @@ $COPYRIGHT$: * to determine how the lines are drawn. */ #include +#include #include #include #include @@ -108,7 +109,7 @@ int main( if (options.debugHelpPrint) { XrmPutFileDatabase(appDB,"db.dthelpprint"); /* dump rsrc for debug */ - system("cat db.dthelpprint|fgrep -i print"); + system("/bin/cat db.dthelpprint|/bin/fgrep -i print"); } /**************************************** diff --git a/cde/programs/dthelp/parser/canon1/util/wchar.c b/cde/programs/dthelp/parser/canon1/util/wchar.c index d49e825f..08c9a0c1 100644 --- a/cde/programs/dthelp/parser/canon1/util/wchar.c +++ b/cde/programs/dthelp/parser/canon1/util/wchar.c @@ -25,6 +25,7 @@ Copyright 1992 Hewlett-Packard Co. */ +#include #include "basic.h" #include "trie.h" #include "cont.h" diff --git a/cde/programs/dthelp/parser/pass2/util/wchar.c b/cde/programs/dthelp/parser/pass2/util/wchar.c index 780bbf40..33d4648d 100644 --- a/cde/programs/dthelp/parser/pass2/util/wchar.c +++ b/cde/programs/dthelp/parser/pass2/util/wchar.c @@ -25,6 +25,7 @@ Copyright 1992 Hewlett-Packard Co. */ +#include #include "basic.h" #include "trie.h" #include "cont.h" diff --git a/cde/programs/dticon/event.c b/cde/programs/dticon/event.c index 20ef5b12..c719114d 100644 --- a/cde/programs/dticon/event.c +++ b/cde/programs/dticon/event.c @@ -55,6 +55,8 @@ ** implied warranty. ** ******************************************************************************/ +#include + #include #include "externals.h" #include "main.h" diff --git a/cde/programs/dticon/fileIO.c b/cde/programs/dticon/fileIO.c index ca03aa0c..b86235d3 100644 --- a/cde/programs/dticon/fileIO.c +++ b/cde/programs/dticon/fileIO.c @@ -452,7 +452,7 @@ Write_File( int i, j; int mask_needed; Boolean SUN; - char *base_name, *suffix, fname[256], *tmp, *tmp2, *vend; + char *base_name, *suffix, fname[MAXPATHLEN], *tmp, *tmp2, *vend; Pixmap scratch_pix; XImage *scratch_shape, *scratch_mask; struct stat statbuf; /* Information on a file. */ @@ -478,7 +478,8 @@ Write_File( netfile = tt_host_file_netfile(fnameIn, tmp+1); localfile = tt_netfile_file(netfile); - strncpy(fname, localfile, MAXPATHLEN); + strncpy(fname, localfile, MAXPATHLEN - 1); + fname[MAXPATHLEN - 1] = 0; tmp[0] = ':'; tt_free(netfile); diff --git a/cde/programs/dtksh/ksh93/ship/shipproto.c b/cde/programs/dtksh/ksh93/ship/shipproto.c index 8d4165d3..b016d0f8 100644 --- a/cde/programs/dtksh/ksh93/ship/shipproto.c +++ b/cde/programs/dtksh/ksh93/ship/shipproto.c @@ -101,7 +101,7 @@ # define ctime _huh_ctime - +# include # include # include # include -- 2.25.1