* put the abstract information about this
* family in the header file
*/
- fprintf (outTopic, GetMessage (3, 3, "<P before 1 first 1 left 1>\n"));
+ fprintf (outTopic, "%s", GetMessage (3, 3, "<P before 1 first 1 left 1>\n"));
if (abstract != NULL)
{
*/
fprintf (out_topic, (GetMessage (3, 2, (char*)defaultTitle14)),
title);
- fprintf (out_topic, (GetMessage (3, 3, "<P before 1 first 1 left 1>\n")));
+ fprintf (out_topic, "%s", (GetMessage (3, 3, "<P before 1 first 1 left 1>\n")));
fprintf (out_topic, "%s\n", abstract);
fprintf (out_topic, "</P>\n");
bitmap, familyName);
}
else
- fprintf (out_header, GetMessage (3, 3, "<P before 1 first 1 left 1>\n"));
+ fprintf (out_header, "%s", GetMessage (3, 3, "<P before 1 first 1 left 1>\n"));
fprintf (out_header, "%s\n", abstract);
fprintf (out_header, "</P></CHARACTERSET>\n");
}
XrmDestroyDatabase (db);
}
+
+ free (token);
return result;
}
};
int i;
for (i=0; usage[i]; i++)
- printf(_DTGETMESSAGE(INSET,i,usage[i]));
+ printf("%s", _DTGETMESSAGE(INSET,i,usage[i]));
} /*$END$*/
\f
char * appclass)
{ /*$CODE$*/
- static struct unprintableMargins
+ struct unprintableMargins
{
int leftUnprintableMargin;
int rightUnprintableMargin;
#define MAXVALIDSIZE 4
/* page size info */
- static struct page
+ struct page
{
int width;
int height;
if (debugHelpPrint)
{
if (*XtRefOffset(options,rsrc->resource_offset))
- printf("options%s: %s\n", rsrc->resource_name,
- *XtRefOffset(options,rsrc->resource_offset));
+ printf("options%s: %s\n", (char *) rsrc->resource_name,
+ (char *) *XtRefOffset(options,rsrc->resource_offset));
else
- printf("options%s: <NULL>\n", rsrc->resource_name);
+ printf("options%s: <NULL>\n", (char *) rsrc->resource_name);
}
}
/* and calculate the page sizes */
newtmpfile=malloc((strlen(dirname) + FILENAMELEN + 2) * sizeof(char));
if (NULL == newtmpfile)
{
- fprintf(stderr, _DTGETMESSAGE(INSET,45,
+ fprintf(stderr, "%s", _DTGETMESSAGE(INSET,45,
"Error: Unable to allocate memory for temporary file\n"));
}
else
{
- sprintf(newtmpfile,_DTGETMESSAGE(INSET,50,"%1$s/%2$s%3$d_%4$d%5$s"),
+ sprintf(newtmpfile, _DTGETMESSAGE(INSET,50,"%1$s/%2$s%3$d_%4$d%5$s"),
dirname, prefix, getpid(), filecnt++, suffix );
}
char cmdFormat[100];
char prOffsetArg[30];
int status;
+ int retval;
if ( NULL == options->stringData )
{
options->colsTextWidth, EMPTY_STR, /* fold */
options->topicTitle, options->rowsHeight, EMPTY_STR); /* pr */
- return _DtHPrGenFileOrPrint(options,"String",printCommand);
+ retval = _DtHPrGenFileOrPrint(options,"String",printCommand);
+ free(printCommand);
+ return retval;
} /*$END$*/
char cmdFormat[100];
char prOffsetArg[30];
int status;
+ int retval;
if ( NULL == options->stringData )
{
options->colsTextWidth, EMPTY_STR, /* fold */
options->topicTitle, options->rowsHeight, EMPTY_STR); /* pr */
-
- return _DtHPrGenFileOrPrint(options,"String",printCommand);
+ retval = _DtHPrGenFileOrPrint(options,"String",printCommand);
+ free(printCommand);
+ return retval;
} /*$END$*/
\f
char *printCommand;
char cmdFormat[100];
int status;
+ int retval;
if ( NULL == options->manPage )
{
}
/** generate the command **/
- sprintf(cmdFormat, "%s %s", /* man */
+ snprintf(cmdFormat, sizeof(cmdFormat), "%s %s", /* man */
options->manCommand, options->manArgs);
- sprintf(printCommand, cmdFormat,
+ snprintf(printCommand, sizeof(MAX_COMMAND_LENGTH*sizeof(char)), cmdFormat,
options->manPage); /* man */
+ retval = _DtHPrGenFileOrPrint(options,options->manPage,printCommand);
+ free(printCommand);
- return _DtHPrGenFileOrPrint(options,options->manPage,printCommand);
+ return retval;
} /*$END$*/
char cmdFormat[100];
char prOffsetArg[30];
int status;
+ int retval;
if ( NULL == options->helpFile )
{
options->colsTextWidth, options->helpFile, /* fold */
options->topicTitle, options->rowsHeight, EMPTY_STR); /* pr */
- return _DtHPrGenFileOrPrint(options,options->helpFile,printCommand);
+ retval = _DtHPrGenFileOrPrint(options,options->helpFile,printCommand);
+ free(printCommand);
+ return retval;
} /*$END$*/
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 */
/* 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;
}
}
/* put the shell print script in there */
- sprintf(printCommand,"%s", options->shCommand,True);
+ sprintf(printCommand,"%s", options->shCommand);
/* set all the options that are IPC to the print script */
PutOpt(printCommand,OPT_LPDEST,options->printer,True);
/* unlink(tmpfile); ** NOTE: don't unlink; let the printCommand do it */
/* note the DTPRINTFILEREMOVE env var setting above */
-
+ free(tmpfile);
return(status);
} /*$END$*/
/* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */
/* Miscellaneous Procedures for HP Tag/TeX translator */
+#include <stdint.h>
+
#include "userinc.h"
#include "globdec.h"
node[n] = current->next;
if (! id[n])
{
- if ((int) current->data >= 0)
+ if ((intptr_t) current->data >= 0)
m_err1("No glossary definition for %s", id);
current = current->next;
while (! current)
*(termp-1) = M_EOS;
}
- idn = (int) m_lookfortrie(base ? base : dterm, >ree);
+ idn = (intptr_t) m_lookfortrie(base ? base : dterm, >ree);
if (idn < 0)
idn = -idn;
if (!idn)
{
idn = NextId();
- m_ntrtrie(base ? base : dterm, >ree, (void *) idn);
+ m_ntrtrie(base ? base : dterm, >ree, (void *) (intptr_t) idn);
}
}
248, "fraction 1/2", UNSUPP, NULL, 0,
251, "French double open quote", UNSUPP, NULL, 0,
252, "Solid square", UNSUPP, NULL, 0,
- 253, "French double close quote", UNSUPP, NULL, NULL
+ 253, "French double close quote", UNSUPP, NULL, 0
/* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */
/* Miscellaneous Procedures for HP Tag/TeX translator */
+#include <stdint.h>
+
#include "userinc.h"
#include "globdec.h"
node[n] = current->next;
if (! id[n])
{
- if ((int) current->data >= 0)
+ if ((intptr_t) current->data >= 0)
m_err1("No glossary definition for %s", id);
current = current->next;
while (! current)
}
_DtLcxCloseDb(&myDb);
+free(charset);
+free(lang);
}
*(termp-1) = M_EOS;
}
- idn = (int) m_lookfortrie(base ? base : dterm, >ree);
+ idn = (intptr_t) m_lookfortrie(base ? base : dterm, >ree);
if (idn < 0)
idn = -idn;
if (!idn)
{
idn = NextId();
- m_ntrtrie(base ? base : dterm, >ree, (void *) idn);
+ m_ntrtrie(base ? base : dterm, >ree, (void *) (intptr_t) idn);
}
}
tex = fopen(helpbase, "w");
fprintf(tex, "\\gobble\001%s\002%%\n", m_signon);
fputs("% Generated Cross-Reference Macros (for a particular document)\n", tex);
-if (! xtree.data) return;
+if (! xtree.data) {
+ fclose(tex);
+ return;
+}
n = 0;
current = xtree.data;
fputs(ndif, dtd) ;
}
SUBONE
+
+ free(mapbysref);
}
/* Output one element block in a template */
char *mb_entcontent;
mb_entcontent = MakeMByteString(entcontent);
-if (!*mb_entcontent) return NULL; /* null file name, don't open a directory */
+if (!mb_entcontent || !*mb_entcontent) return NULL; /* null file name, don't open a directory */
open = fopen(mb_entcontent, "r");
if (open)
if (! newtransit || (loading && ! newdlm))
{
trysize = NUMDELIM + 1;
+ free(newtransit);
newtransit = (int *) calloc(NUMCON * trysize, sizeof(int));
- if (loading) newdlm = (char **) calloc(trysize, sizeof(M_WCHAR *));
+ if (loading) {
+ free(newdlm);
+ newdlm = (char **) calloc(trysize, sizeof(M_WCHAR *));
+ }
}
if (! newtransit || (loading && ! newdlm))
{
ret = system(pcmd);
ret = snprintf(pcmd, slen, "touch %s",pfile2);
ret = system(pcmd);
+ free(pcmd);
}
int nextchar(file, data)
#endif
) ;
-void m_free(block, msg)
- void *block ;
- char *msg ;
+void m_free(void *block, char *msg)
{
char buffer[32] ;
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
- free(block) ;
if (m_malftrace) {
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__)
snprintf(buffer, 32, "%5x:%5x",
m_trace(msg) ;
m_trace("\n") ;
}
+ free(block) ;
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif