From 561d85814085388aef399d2a4a32e0a0f27aea11 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Wed, 7 Jan 2015 14:19:38 +0000 Subject: [PATCH] dticon: resolve 3 compiler warnings --- cde/programs/dticon/help.c | 3 ++- cde/programs/dticon/main.c | 2 +- cde/programs/dticon/utils.c | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cde/programs/dticon/help.c b/cde/programs/dticon/help.c index b27c8088..525a1689 100644 --- a/cde/programs/dticon/help.c +++ b/cde/programs/dticon/help.c @@ -59,6 +59,7 @@ ** ******************************************************************************/ #include +#include #include #include #include @@ -332,7 +333,7 @@ HelpTriggerCB( stat_out("Entering HelpTriggerCB: help-tag=%d\n", (int) client_data); #endif - HelpSetVolAndLocation((int) client_data); + HelpSetVolAndLocation((int) (intptr_t) client_data); #ifdef DEBUG if (debug) diff --git a/cde/programs/dticon/main.c b/cde/programs/dticon/main.c index 83edad52..3d458881 100644 --- a/cde/programs/dticon/main.c +++ b/cde/programs/dticon/main.c @@ -363,7 +363,7 @@ main( static void ExitCB (Widget dialog, XtPointer client_data, XtPointer call_data) { - exit((int) client_data); + exit((int) (intptr_t) client_data); } void diff --git a/cde/programs/dticon/utils.c b/cde/programs/dticon/utils.c index 30345291..dd689f94 100644 --- a/cde/programs/dticon/utils.c +++ b/cde/programs/dticon/utils.c @@ -2341,7 +2341,12 @@ SaveSession( void ) if (last_fname[0] != '\0') sprintf(bufr, "%s*file: %s\n", bufr, last_fname); - write (fd, bufr, strlen(bufr)); + if(-1 == write (fd, bufr, strlen(bufr))) { + fprintf(stderr, "write() to session failed\n"); + XtFree ((char *)path); + XtFree ((char *)name); + return; + } n = 0; -- 2.25.1