From b41cf28662fe5734530f280cc0dbb34bbf6aa25a Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sat, 16 Apr 2005 00:01:49 +0000 Subject: Update "clean" targets to properly handle core files, remove backup files, etc. Add "install" target to test directory which installs the example programs. Install the config.h file in the examples directory. Make sure the example programs compile outside the FLTK source dir. Add example programs to fltk.list.in. Fix missing redraw() in x_cb() in FLUID... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4287 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/file_chooser.cxx | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'test/file_chooser.cxx') diff --git a/test/file_chooser.cxx b/test/file_chooser.cxx index f0867b627..a595e4df6 100644 --- a/test/file_chooser.cxx +++ b/test/file_chooser.cxx @@ -44,7 +44,7 @@ #include #include #include -#include "../src/flstring.h" +#include // @@ -220,12 +220,12 @@ pdf_check(const char *name, // I - Name of file return 0; home = getenv("HOME"); - snprintf(preview, sizeof(preview), "%s/.preview.ppm", home ? home : ""); + sprintf(preview, "%s/.preview.ppm", home ? home : ""); - snprintf(command, sizeof(command), - "gs -r100 -dFIXED -sDEVICE=ppmraw -dQUIET -dNOPAUSE -dBATCH " - "-sstdout=\"%%stderr\" -sOUTPUTFILE=\'%s\' " - "-dFirstPage=1 -dLastPage=1 \'%s\' 2>/dev/null", preview, name); + sprintf(command, + "gs -r100 -dFIXED -sDEVICE=ppmraw -dQUIET -dNOPAUSE -dBATCH " + "-sstdout=\"%%stderr\" -sOUTPUTFILE=\'%s\' " + "-dFirstPage=1 -dLastPage=1 \'%s\' 2>/dev/null", preview, name); if (system(command)) return 0; @@ -256,11 +256,11 @@ ps_check(const char *name, // I - Name of file return 0; home = getenv("HOME"); - snprintf(preview, sizeof(preview), "%s/.preview.ppm", home ? home : ""); + sprintf(preview, "%s/.preview.ppm", home ? home : ""); if (memcmp(header, "%!PS", 4) == 0) { // PS file has DSC comments; extract the first page... - snprintf(outname, sizeof(outname), "%s/.preview.ps", home ? home : ""); + sprintf(outname, "%s/.preview.ps", home ? home : ""); if (strcmp(name, outname) != 0) { in = fopen(name, "rb"); @@ -281,13 +281,14 @@ ps_check(const char *name, // I - Name of file } } else { // PS file doesn't have DSC comments; do the whole file... - strlcpy(outname, name, sizeof(outname)); + strncpy(outname, name, sizeof(outname) - 1); + outname[sizeof(outname) - 1] = '\0'; } - snprintf(command, sizeof(command), - "gs -r100 -dFIXED -sDEVICE=ppmraw -dQUIET -dNOPAUSE -dBATCH " - "-sstdout=\"%%stderr\" -sOUTPUTFILE=\'%s\' \'%s\' 2>/dev/null", - preview, outname); + sprintf(command, + "gs -r100 -dFIXED -sDEVICE=ppmraw -dQUIET -dNOPAUSE -dBATCH " + "-sstdout=\"%%stderr\" -sOUTPUTFILE=\'%s\' \'%s\' 2>/dev/null", + preview, outname); if (system(command)) return 0; -- cgit v1.2.3