diff options
Diffstat (limited to 'converter/other')
-rw-r--r-- | converter/other/exif.c | 16 | ||||
-rw-r--r-- | converter/other/giftopnm.c | 60 | ||||
-rw-r--r-- | converter/other/jpeg2000/pamtojpeg2k.c | 94 | ||||
-rw-r--r-- | converter/other/jpegtopnm.c | 2 | ||||
-rw-r--r-- | converter/other/pamtofits.c | 4 | ||||
-rw-r--r-- | converter/other/pamtosvg/pamtosvg.c | 8 | ||||
-rw-r--r-- | converter/other/pamtotga.c | 4 | ||||
-rw-r--r-- | converter/other/pamtouil.c | 4 | ||||
-rw-r--r-- | converter/other/pngtopam.c | 8 | ||||
-rw-r--r-- | converter/other/pngtxt.c | 2 | ||||
-rw-r--r-- | converter/other/pnmtopng.c | 34 | ||||
-rw-r--r-- | converter/other/pnmtops.c | 2 | ||||
-rw-r--r-- | converter/other/pstopnm.c | 34 | ||||
-rw-r--r-- | converter/other/svgtopam.c | 12 | ||||
-rw-r--r-- | converter/other/tifftopnm.c | 18 |
15 files changed, 151 insertions, 151 deletions
diff --git a/converter/other/exif.c b/converter/other/exif.c index 2f9a998f..6178d9a2 100644 --- a/converter/other/exif.c +++ b/converter/other/exif.c @@ -770,20 +770,20 @@ process_EXIF(unsigned char * const ExifData, fprintf(stderr, "Exif header in Motorola order\n"); MotorolaOrder = 1; } else { - asprintfN(errorP, "Invalid alignment marker in Exif " - "data. First two bytes are '%c%c' (0x%02x%02x) " - "instead of 'II' or 'MM'.", - ExifData[0], ExifData[1], ExifData[0], ExifData[1]); + pm_asprintf(errorP, "Invalid alignment marker in Exif " + "data. First two bytes are '%c%c' (0x%02x%02x) " + "instead of 'II' or 'MM'.", + ExifData[0], ExifData[1], ExifData[0], ExifData[1]); } } if (!*errorP) { unsigned short const start = Get16u(ExifData + 2); /* Check the next value for correctness. */ if (start != 0x002a){ - asprintfN(errorP, "Invalid Exif header start. " - "two bytes after the alignment marker " - "should be 0x002a, but is 0x%04x", - start); + pm_asprintf(errorP, "Invalid Exif header start. " + "two bytes after the alignment marker " + "should be 0x002a, but is 0x%04x", + start); } } if (!*errorP) { diff --git a/converter/other/giftopnm.c b/converter/other/giftopnm.c index fc826102..faab1086 100644 --- a/converter/other/giftopnm.c +++ b/converter/other/giftopnm.c @@ -77,13 +77,13 @@ readFile(FILE * const ifP, *errorP = NULL; else { if (ferror(ifP)) - asprintfN(errorP, "Error reading file. errno=%d (%s)", - errno, strerror(errno)); + pm_asprintf(errorP, "Error reading file. errno=%d (%s)", + errno, strerror(errno)); else if (feof(ifP)) - asprintfN(errorP, "End of file encountered"); + pm_asprintf(errorP, "End of file encountered"); else - asprintfN(errorP, "Short read -- %u bytes of %u", - (unsigned)bytesRead, (unsigned)len); + pm_asprintf(errorP, "Short read -- %u bytes of %u", + (unsigned)bytesRead, (unsigned)len); } } @@ -323,9 +323,9 @@ getDataBlock(FILE * const ifP, if (successfulRead) *errorP = NULL; else - asprintfN(errorP, - "EOF or error reading data portion of %u byte " - "DataBlock from file", count); + pm_asprintf(errorP, + "EOF or error reading data portion of %u byte " + "DataBlock from file", count); } } } @@ -907,8 +907,8 @@ expandCodeOntoStack(struct decompressor * const decompP, while (code > decompP->max_dataVal && !error) { if (stringCount > maxnum_lzwCode) { - asprintfN(&error, - "Error in GIF image: contains LZW string loop"); + pm_asprintf(&error, + "Error in GIF image: contains LZW string loop"); } else { ++stringCount; pushStack(&decompP->stack, decompP->table[1][code]); @@ -1015,8 +1015,8 @@ lzwReadByte(struct decompressor * const decompP, &eof, &code, errorP); if (!*errorP) { if (eof) - asprintfN(errorP, - "Premature end of file; no proper GIF closing"); + pm_asprintf(errorP, + "Premature end of file; no proper GIF closing"); else { if (code == decompP->clear_code) { resetDecompressor(decompP); @@ -1155,12 +1155,12 @@ verifyPixelRead(bool const endOfImage, *errorP = strdup(readError); else { if (endOfImage) - asprintfN(errorP, - "Error in GIF image: Not enough raster data to fill " - "%u x %u dimensions. Ran out of raster data in " - "row %u. The image has proper ending sequence, so " - "this is not just a truncated file.", - cols, rows, failedRowNum); + pm_asprintf(errorP, + "Error in GIF image: Not enough raster data to fill " + "%u x %u dimensions. Ran out of raster data in " + "row %u. The image has proper ending sequence, so " + "this is not just a truncated file.", + cols, rows, failedRowNum); else *errorP = NULL; } @@ -1208,7 +1208,7 @@ readRaster(struct decompressor * const decompP, &error); if (readError) - strfree(readError); + pm_strfree(readError); if (error) { if (tolerateBadInput) { @@ -1243,7 +1243,7 @@ skipExtraneousData(struct decompressor * const decompP) { lzwReadByte(decompP, &byteRead, &endOfImage, &error); if (error) - strfree(error); + pm_strfree(error); else if (!endOfImage) { pm_message("Extraneous data at end of image. " "Skipped to end of image"); @@ -1254,7 +1254,7 @@ skipExtraneousData(struct decompressor * const decompP) { if (error) { pm_message("Error encountered skipping to end of image: %s", error); - strfree(error); + pm_strfree(error); } } } @@ -1463,10 +1463,10 @@ readExtensions(FILE* const ifP, readFile(ifP, &c, 1, &error); if (error) { - asprintfN(errorP, "File read error where start of image " - "descriptor or end of GIF expected. %s", - error); - strfree(error); + pm_asprintf(errorP, "File read error where start of image " + "descriptor or end of GIF expected. %s", + error); + pm_strfree(error); } else { if (c == ';') { /* GIF terminator */ eod = TRUE; @@ -1477,10 +1477,10 @@ readExtensions(FILE* const ifP, readFile(ifP, &functionCode, 1, &error); if (error) { - asprintfN(errorP, "Failed to read function code " - "of GIF extension (immediately after the '!' " - "extension delimiter) from input. %s", error); - strfree(error); + pm_asprintf(errorP, "Failed to read function code " + "of GIF extension (immediately after the '!' " + "extension delimiter) from input. %s", error); + pm_strfree(error); } else { doExtension(ifP, functionCode, gif89P); } @@ -1612,7 +1612,7 @@ disposeOfReadExtensionsError(const char * const error, else pm_error("Error accessing Image %u of stream. %s", imageSeq, error); - strfree(error); + pm_strfree(error); *eodP = TRUE; } } diff --git a/converter/other/jpeg2000/pamtojpeg2k.c b/converter/other/jpeg2000/pamtojpeg2k.c index 4ccbe456..731ee38c 100644 --- a/converter/other/jpeg2000/pamtojpeg2k.c +++ b/converter/other/jpeg2000/pamtojpeg2k.c @@ -380,7 +380,7 @@ writeJpc(jas_image_t * const jasperP, specifying garbage for the -ilyrrates option */ if (strlen(cmdline.ilyrrates) > 0) - asprintfN(&ilyrratesOpt, "ilyrrates=%s", cmdline.ilyrrates); + pm_asprintf(&ilyrratesOpt, "ilyrrates=%s", cmdline.ilyrrates); else ilyrratesOpt = strdup(""); @@ -396,52 +396,52 @@ writeJpc(jas_image_t * const jasperP, sprintf(rateOpt, "%1.9f", 1.0/cmdline.compressionRatio); - asprintfN(&options, - "imgareatlx=%u " - "imgareatly=%u " - "tilegrdtlx=%u " - "tilegrdtly=%u " - "tilewidth=%u " - "tileheight=%u " - "prcwidth=%u " - "prcheight=%u " - "cblkwidth=%u " - "cblkheight=%u " - "mode=%s " - "rate=%s " - "%s " - "prg=%s " - "numrlvls=%u " - "numgbits=%u " - "%s %s %s %s %s %s %s %s %s", - - cmdline.imgareatlx, - cmdline.imgareatly, - cmdline.tilegrdtlx, - cmdline.tilegrdtlx, - cmdline.tilewidth, - cmdline.tileheight, - cmdline.prcwidth, - cmdline.prcheight, - cmdline.cblkwidth, - cmdline.cblkheight, - cmdline.compmode == COMPMODE_INTEGER ? "int" : "real", - rateOpt, - ilyrratesOpt, - prgValue, - cmdline.numrlvls, - cmdline.numgbits, - cmdline.nomct ? "nomct" : "", - cmdline.sop ? "sop" : "", - cmdline.eph ? "eph" : "", - cmdline.lazy ? "lazy" : "", - cmdline.termall ? "termall" : "", - cmdline.segsym ? "segsym" : "", - cmdline.vcausal ? "vcausal" : "", - cmdline.pterm ? "pterm" : "", - cmdline.resetprob ? "resetprob" : "" + pm_asprintf(&options, + "imgareatlx=%u " + "imgareatly=%u " + "tilegrdtlx=%u " + "tilegrdtly=%u " + "tilewidth=%u " + "tileheight=%u " + "prcwidth=%u " + "prcheight=%u " + "cblkwidth=%u " + "cblkheight=%u " + "mode=%s " + "rate=%s " + "%s " + "prg=%s " + "numrlvls=%u " + "numgbits=%u " + "%s %s %s %s %s %s %s %s %s", + + cmdline.imgareatlx, + cmdline.imgareatly, + cmdline.tilegrdtlx, + cmdline.tilegrdtlx, + cmdline.tilewidth, + cmdline.tileheight, + cmdline.prcwidth, + cmdline.prcheight, + cmdline.cblkwidth, + cmdline.cblkheight, + cmdline.compmode == COMPMODE_INTEGER ? "int" : "real", + rateOpt, + ilyrratesOpt, + prgValue, + cmdline.numrlvls, + cmdline.numgbits, + cmdline.nomct ? "nomct" : "", + cmdline.sop ? "sop" : "", + cmdline.eph ? "eph" : "", + cmdline.lazy ? "lazy" : "", + cmdline.termall ? "termall" : "", + cmdline.segsym ? "segsym" : "", + cmdline.vcausal ? "vcausal" : "", + cmdline.pterm ? "pterm" : "", + cmdline.resetprob ? "resetprob" : "" ); - strfree(ilyrratesOpt); + pm_strfree(ilyrratesOpt); /* Open the output image file (Standard Output) */ @@ -478,7 +478,7 @@ writeJpc(jas_image_t * const jasperP, jas_image_clearfmts(); - strfree(options); + pm_strfree(options); } diff --git a/converter/other/jpegtopnm.c b/converter/other/jpegtopnm.c index 59c18de4..790abff2 100644 --- a/converter/other/jpegtopnm.c +++ b/converter/other/jpegtopnm.c @@ -662,7 +662,7 @@ print_exif_info(struct jpeg_marker_struct const marker) { if (error) { pm_message("EXIF header is invalid. %s", error); - strfree(error); + pm_strfree(error); } else ShowImageInfo(&imageInfo); } diff --git a/converter/other/pamtofits.c b/converter/other/pamtofits.c index 85ff7aaa..92e29c7e 100644 --- a/converter/other/pamtofits.c +++ b/converter/other/pamtofits.c @@ -111,11 +111,11 @@ writeHeaderCard(const char * const s) { -----------------------------------------------------------------------------*/ const char * card; - asprintfN(&card, "%-80.80s", s); + pm_asprintf(&card, "%-80.80s", s); fwrite(card, sizeof(card[0]), 80, stdout); - strfree(card); + pm_strfree(card); } diff --git a/converter/other/pamtosvg/pamtosvg.c b/converter/other/pamtosvg/pamtosvg.c index 0e66bdb5..72aa4151 100644 --- a/converter/other/pamtosvg/pamtosvg.c +++ b/converter/other/pamtosvg/pamtosvg.c @@ -334,7 +334,7 @@ openLogFile(FILE ** const logFileP, const char * logfileName; if (streq(inputFileArg, "-")) - asprintfN(&logfileName, "pamtosvg.log"); + pm_asprintf(&logfileName, "pamtosvg.log"); else { const char * inputRootName; @@ -343,14 +343,14 @@ openLogFile(FILE ** const logFileP, pm_error("Can't find the root portion of file name '%s'", inputFileArg); - asprintfN(&logfileName, "%s.log", inputRootName); + pm_asprintf(&logfileName, "%s.log", inputRootName); - strfree(inputRootName); + pm_strfree(inputRootName); } *logFileP = pm_openw(logfileName); - strfree(logfileName); + pm_strfree(logfileName); } diff --git a/converter/other/pamtotga.c b/converter/other/pamtotga.c index d4aea399..aca93015 100644 --- a/converter/other/pamtotga.c +++ b/converter/other/pamtotga.c @@ -463,7 +463,7 @@ static void releaseTgaHeader(struct ImageHeader const tgaHeader) { if (tgaHeader.IdLength > 0) - strfree(tgaHeader.Id); + pm_strfree(tgaHeader.Id); } @@ -567,7 +567,7 @@ main(int argc, char *argv[]) { pnm_freetupletable(&pam, chv); releaseTgaHeader(tgaHeader); - strfree(outName); + pm_strfree(outName); pnm_freepamarray(tuples, &pam); return 0; diff --git a/converter/other/pamtouil.c b/converter/other/pamtouil.c index 252b29d0..ee7f5ae6 100644 --- a/converter/other/pamtouil.c +++ b/converter/other/pamtouil.c @@ -374,9 +374,9 @@ freeCmap(cixel_map const cmap[], for (i = 0; i < ncolors; ++i) { cixel_map const cmapEntry = cmap[i]; if (cmapEntry.uilname) - strfree(cmapEntry.uilname); + pm_strfree(cmapEntry.uilname); if (cmapEntry.rgbname) - strfree(cmapEntry.rgbname); + pm_strfree(cmapEntry.rgbname); } } diff --git a/converter/other/pngtopam.c b/converter/other/pngtopam.c index 9609ff4e..f7767404 100644 --- a/converter/other/pngtopam.c +++ b/converter/other/pngtopam.c @@ -471,11 +471,11 @@ dumpPngInfo(struct pngx * const pngxP) { switch (info_ptr->filter_type) { case PNG_FILTER_TYPE_BASE: - asprintfN(&filter_string, "base filter"); + pm_asprintf(&filter_string, "base filter"); break; default: - asprintfN(&filter_string, "unknown filter type %d", - info_ptr->filter_type); + pm_asprintf(&filter_string, "unknown filter type %d", + info_ptr->filter_type); } pm_message("reading a %ldw x %ldh image, %d bit%s", @@ -494,7 +494,7 @@ dumpPngInfo(struct pngx * const pngxP) { info_ptr->background.green, info_ptr->background.blue); - strfree(filter_string); + pm_strfree(filter_string); if (info_ptr->valid & PNG_INFO_tRNS) pm_message("tRNS chunk (transparency): %u entries", diff --git a/converter/other/pngtxt.c b/converter/other/pngtxt.c index bbbec099..e35450d7 100644 --- a/converter/other/pngtxt.c +++ b/converter/other/pngtxt.c @@ -299,7 +299,7 @@ pnmpng_read_text (png_info * const info_ptr, textline, lineLength); } } - strfree(textline); + pm_strfree(textline); } } if (noCommentsYet) diff --git a/converter/other/pnmtopng.c b/converter/other/pnmtopng.c index db9d6458..5de3fdc1 100644 --- a/converter/other/pnmtopng.c +++ b/converter/other/pnmtopng.c @@ -1799,10 +1799,10 @@ tryAlphaPalette(FILE * const ifP, palette_pnm, trans_pnm, paletteSizeP, transSizeP, &tooBig); if (tooBig) { - asprintfN(impossibleReasonP, - "too many color/transparency pairs " - "(more than the PNG maximum of %u", - MAXPALETTEENTRIES); + pm_asprintf(impossibleReasonP, + "too many color/transparency pairs " + "(more than the PNG maximum of %u", + MAXPALETTEENTRIES); } else *impossibleReasonP = NULL; } @@ -1939,11 +1939,11 @@ computeColorMap(FILE * const ifP, of that color as *backgroundIndexP. -------------------------------------------------------------------------- */ if (force) - asprintfN(noColormapReasonP, "You requested no color map"); + pm_asprintf(noColormapReasonP, "You requested no color map"); else if (maxval > PALETTEMAXVAL) - asprintfN(noColormapReasonP, "The maxval of the input image (%u) " - "exceeds the PNG palette maxval (%u)", - maxval, PALETTEMAXVAL); + pm_asprintf(noColormapReasonP, "The maxval of the input image (%u) " + "exceeds the PNG palette maxval (%u)", + maxval, PALETTEMAXVAL); else { unsigned int bitsPerPixel; computePixelWidth(PNM_FORMAT_TYPE(format), pnm_meaningful_bits, alpha, @@ -1953,7 +1953,7 @@ computeColorMap(FILE * const ifP, /* No palette can beat 1 bit per pixel -- no need to waste time counting the colors. */ - asprintfN(noColormapReasonP, "pixel is already only 1 bit"); + pm_asprintf(noColormapReasonP, "pixel is already only 1 bit"); else { /* We'll have to count the colors ('colors') to know if a palette is possible and desirable. Along the way, we'll @@ -1967,16 +1967,16 @@ computeColorMap(FILE * const ifP, &chv, &colors); if (chv == NULL) { - asprintfN(noColormapReasonP, - "More than %u colors found -- too many for a " - "colormapped PNG", MAXCOLORS); + pm_asprintf(noColormapReasonP, + "More than %u colors found -- too many for a " + "colormapped PNG", MAXCOLORS); } else { /* There are few enough colors that a palette is possible */ if (bitsPerPixel <= paletteIndexBits(colors) && !pfP) - asprintfN(noColormapReasonP, - "palette index for %u colors would be " - "no smaller than the indexed value (%u bits)", - colors, bitsPerPixel); + pm_asprintf(noColormapReasonP, + "palette index for %u colors would be " + "no smaller than the indexed value (%u bits)", + colors, bitsPerPixel); else { unsigned int paletteSize; unsigned int transSize; @@ -2727,7 +2727,7 @@ convertpnm(struct cmdlineInfo const cmdline, noColormapReason); if (verbose) pm_message("Not using color map. %s", noColormapReason); - strfree(noColormapReason); + pm_strfree(noColormapReason); colorMapped = FALSE; } else colorMapped = TRUE; diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c index 4bd59ed2..fae34861 100644 --- a/converter/other/pnmtops.c +++ b/converter/other/pnmtops.c @@ -1406,7 +1406,7 @@ main(int argc, char * argv[]) { pnm_nextimage(ifp, &eof); } } - strfree(name); + pm_strfree(name); pm_close(ifp); diff --git a/converter/other/pstopnm.c b/converter/other/pstopnm.c index 5f4d66a9..d9ce201f 100644 --- a/converter/other/pstopnm.c +++ b/converter/other/pstopnm.c @@ -218,14 +218,14 @@ addPsToFilespec(char const orig_filespec[], else { const char *filespec_plus_ps; - asprintfN(&filespec_plus_ps, "%s.ps", orig_filespec); + pm_asprintf(&filespec_plus_ps, "%s.ps", orig_filespec); stat_rc = lstat(filespec_plus_ps, &statbuf); if (stat_rc == 0) *new_filespec_p = strdup(filespec_plus_ps); else *new_filespec_p = strdup(orig_filespec); - strfree(filespec_plus_ps); + pm_strfree(filespec_plus_ps); } if (verbose) pm_message("Input file is %s", *new_filespec_p); @@ -560,12 +560,12 @@ computePstrans(struct box const box, int llx, lly; llx = box.llx - (xsize * 72 / xres - (box.urx - box.llx)) / 2; lly = box.lly - (ysize * 72 / yres - (box.ury - box.lly)) / 2; - asprintfN(&retval, "%d neg %d neg translate", llx, lly); + pm_asprintf(&retval, "%d neg %d neg translate", llx, lly); } else { int llx, ury; llx = box.llx - (ysize * 72 / yres - (box.urx - box.llx)) / 2; ury = box.ury + (xsize * 72 / xres - (box.ury - box.lly)) / 2; - asprintfN(&retval, "90 rotate %d neg %d neg translate", llx, ury); + pm_asprintf(&retval, "90 rotate %d neg %d neg translate", llx, ury); } if (retval == NULL) @@ -602,9 +602,9 @@ computeOutfileArg(struct cmdlineInfo const cmdline) { default: pm_error("Internal error: invalid value for format_type: %d", cmdline.format_type); } - asprintfN(&retval, "%s%%03d.%s", basename, suffix); + pm_asprintf(&retval, "%s%%03d.%s", basename, suffix); - strfree(basename); + pm_strfree(basename); } return(retval); } @@ -627,7 +627,7 @@ computeGsDevice(int const format_type, if (forceplain) retval = strdup(basetype); else - asprintfN(&retval, "%sraw", basetype); + pm_asprintf(&retval, "%sraw", basetype); if (retval == NULL) pm_error("Unable to allocate memory for gs device"); @@ -658,7 +658,7 @@ findGhostscriptProg(const char ** const retvalP) { const char * filename; int rc; - asprintfN(&filename, "%s/gs", candidate); + pm_asprintf(&filename, "%s/gs", candidate); rc = stat(filename, &statbuf); if (rc == 0) { if (S_ISREG(statbuf.st_mode)) @@ -667,7 +667,7 @@ findGhostscriptProg(const char ** const retvalP) { pm_error("Error looking for Ghostscript program. " "stat(\"%s\") returns errno %d (%s)", filename, errno, strerror(errno)); - strfree(filename); + pm_strfree(filename); candidate = strtok(NULL, ":"); } @@ -705,11 +705,11 @@ execGhostscript(int const inputPipeFd, rc = dup2(inputPipeFd, STDIN_FILENO); close(inputPipeFd); - asprintfN(&arg0, "gs"); - asprintfN(&deviceopt, "-sDEVICE=%s", ghostscript_device); - asprintfN(&outfileopt, "-sOutputFile=%s", outfile_arg); - asprintfN(&gopt, "-g%dx%d", xsize, ysize); - asprintfN(&ropt, "-r%dx%d", xres, yres); + pm_asprintf(&arg0, "gs"); + pm_asprintf(&deviceopt, "-sDEVICE=%s", ghostscript_device); + pm_asprintf(&outfileopt, "-sOutputFile=%s", outfile_arg); + pm_asprintf(&gopt, "-g%dx%d", xsize, ysize); + pm_asprintf(&ropt, "-r%dx%d", xres, yres); /* -dSAFER causes Postscript to disable %pipe and file operations, which are almost certainly not needed here. This prevents our @@ -901,9 +901,9 @@ main(int argc, char ** argv) { xsize, ysize, xres, yres, input_filespec, language, cmdline.verbose); - strfree(ghostscript_device); - strfree(outfile_arg); - strfree(pstrans); + pm_strfree(ghostscript_device); + pm_strfree(outfile_arg); + pm_strfree(pstrans); return 0; } diff --git a/converter/other/svgtopam.c b/converter/other/svgtopam.c index d2e2a186..26530b9b 100644 --- a/converter/other/svgtopam.c +++ b/converter/other/svgtopam.c @@ -193,7 +193,7 @@ destroyPath(path * const pathP) { assert(pathP->pathTextLength == strlen(pathP->pathText)); - strfree(pathP->pathText); + pm_strfree(pathP->pathText); free(pathP); } @@ -519,7 +519,7 @@ interpretStyle(const char * const styleAttr) { p = &buffer[0]; while (p) { - const char * const token = strsepN(&p, ";"); + const char * const token = pm_strsep(&p, ";"); const char * strippedToken; const char * p; char * buffer; @@ -662,14 +662,14 @@ stringToUint(const char * const string, /* TODO: move this to nstring.c */ if (strlen(string) == 0) - asprintfN(errorP, "Value is a null string"); + pm_asprintf(errorP, "Value is a null string"); else { char * tailptr; *uintP = strtoul(string, &tailptr, 10); if (*tailptr != '\0') - asprintfN(errorP, "Non-numeric crap in string: '%s'", tailptr); + pm_asprintf(errorP, "Non-numeric crap in string: '%s'", tailptr); else *errorP = NULL; } @@ -690,12 +690,12 @@ getSvgAttributes(xmlTextReaderPtr const xmlReaderP, stringToUint(width, colsP, &error); if (error) { pm_error("'width' attribute of <svg> has invalid value. %s", error); - strfree(error); + pm_strfree(error); } stringToUint(height, rowsP, &error); if (error) { pm_error("'height' attribute of <svg> has invalid value. %s", error); - strfree(error); + pm_strfree(error); } } diff --git a/converter/other/tifftopnm.c b/converter/other/tifftopnm.c index 0f6e71b8..67e7c52f 100644 --- a/converter/other/tifftopnm.c +++ b/converter/other/tifftopnm.c @@ -730,8 +730,8 @@ spawnWithInputPipe(const char * const shellCmd, rc = pipe(fd); if (rc != 0) - asprintfN(errorP, "Failed to create pipe for process input. " - "Errno=%d (%s)", errno, strerror(errno)); + pm_asprintf(errorP, "Failed to create pipe for process input. " + "Errno=%d (%s)", errno, strerror(errno)); else { int iAmParent; pid_t childPid; @@ -746,9 +746,9 @@ spawnWithInputPipe(const char * const shellCmd, *pipePP = fdopen(fd[PIPE_WRITE], "w"); if (*pipePP == NULL) - asprintfN(errorP,"Unable to create stream from pipe. " - "fdopen() fails with errno=%d (%s)", - errno, strerror(errno)); + pm_asprintf(errorP,"Unable to create stream from pipe. " + "fdopen() fails with errno=%d (%s)", + errno, strerror(errno)); else *errorP = NULL; } else { @@ -800,8 +800,8 @@ createFlipProcess(FILE * const outFileP, file descriptor is equivalent to writing to the stream. */ - asprintfN(&pamflipCmd, "pamflip -xform=%s >&%u", - xformNeeded(orientation), fileno(outFileP)); + pm_asprintf(&pamflipCmd, "pamflip -xform=%s >&%u", + xformNeeded(orientation), fileno(outFileP)); if (verbose) pm_message("Reorienting raster with shell command '%s'", pamflipCmd); @@ -813,7 +813,7 @@ createFlipProcess(FILE * const outFileP, "raster, failed. %s. To work around this, you can use " "the -orientraw option.", pamflipCmd, error); - strfree(error); + pm_strfree(error); } } @@ -1651,7 +1651,7 @@ main(int argc, const char * argv[]) { if (alphaFile != NULL) pm_close( alphaFile ); - strfree(cmdline.inputFilename); + pm_strfree(cmdline.inputFilename); /* If the program failed, it previously aborted with nonzero completion code, via various function calls. */ |