+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these libraries and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
#if DOC
/*===================================================================
$FILEBEG$: PrintTopics.c
#endif
#include <errno.h>
+#include <time.h>
#include "HelpPrintI.h" /* helpprint */
wcstr[--wclen] = EOS;
wcstombs(str,wcstr,len+1);
+ free(wcstr);
+
return wclen;
} /*$END$*/
/* put into state data */
state->hffArgs.volumeDate = strdup(buf);
state->hffArgs.volumeDateColsWidth = width;
+
+ free(locDocId);
+ free(locDateStamp);
}
/* get today's date */
free(formattedStr);
/*** output the str ***/
- fprintf(topicsFP,buf);
+ fprintf(topicsFP, "%s", buf);
return lineCnt;
} /*$END$*/
/* if processing subtopics, reset subsection number */
if(subSectNumIndex > 1) state->sectNums[subSectNumIndex] = 0;
state->level = level; /* state->level was modified by the FOR loop */
+
+ free(children);
return ret;
}
/* if processing subtopics, start processing at the top */
if ( processSubTopics )
{
- char * name = NULL;
int offset;
/* get the top topic of the volume */
ret = _DtHelpCeGetTopTopicId(state->volHandle, &state->currentLocId);
if (ret != True) state->currentLocId = strdup("_HOMETOPIC");
- if(name) free(name);
}
else
{ /* otherwise, process only where needed */
char * buf;
char * start;
char * next;
- char * pgbrkFile;
+ char * pgbrkFile = NULL;
char * partFiles[NUMPARTS];
Boolean validFile = False;
/* only do the operation if there are valid files */
if (validFile)
{
+ int rv;
sprintf(next,"> %s", *ret_resultsFile);
if(options->debugHelpPrint) printf("%s\n",buf);
- system(buf);
+ rv = system(buf);
}
free(buf);
ret = 0;
unlink(partFiles[i]);
free(partFiles[i]);
}
- unlink(pgbrkFile);
+
+ if(pgbrkFile) {
+ unlink(pgbrkFile);
+ }
/* NOTE: should free Toc here if interested in no leaks */