From 67ef980644c2f5626ad29a3eb7868d52ed43bfa0 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Sun, 4 Jul 2021 17:48:41 +0100 Subject: [PATCH] DtSvc: fix error return from DtHelpReturnSelectedWidgetId return(NULL) is correct for the other functions here but not for this one, since it's meant to return a DtHELP_ error code. The man page also says it should also set *widget to NULL on error. --- cde/lib/DtSvc/DtUtil2/SunDtHelp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cde/lib/DtSvc/DtUtil2/SunDtHelp.c b/cde/lib/DtSvc/DtUtil2/SunDtHelp.c index 759a87554..b133fdc8b 100644 --- a/cde/lib/DtSvc/DtUtil2/SunDtHelp.c +++ b/cde/lib/DtSvc/DtUtil2/SunDtHelp.c @@ -163,8 +163,10 @@ int _DtHelpReturnSelectedWidgetId( status = pmySUNWProcList || SUNWDtHelpdlopen(); _DtSvcProcessUnlock(); - if (!status) - return(NULL); + if (!status) { + *widget = NULL; + return(DtHELP_SELECT_ERROR); + } return ((*pmySUNWProcList->DtHelpReturnSelectedWidgetIdSym)(parent, cursor, widget));