Altre correzioni su memory mapping ed esempi
[gapil.git] / sources / BarCode.c
index 4164acf1b2392782a0d74808fefb5ea1d310057f..122ad6b1f5289691dbd43f25441799523715d88d 100644 (file)
@@ -29,7 +29,7 @@
  * http://localhost/cgi-bin/barcode?string
  * where string is the code to be converted
  *
- * $Id: BarCode.c,v 1.5 2002/06/28 21:07:21 piccardi Exp $ 
+ * $Id: BarCode.c,v 1.7 2003/01/06 16:44:20 piccardi Exp $ 
  *
  ****************************************************************/
 /* 
@@ -48,8 +48,6 @@
 #include <time.h>
 
 #include"macros.h"
-void WriteMess(char *mess);
-
 
 /* Program begin */
 int main(int argc, char *argv[], char *envp[])
@@ -67,7 +65,7 @@ int main(int argc, char *argv[], char *envp[])
     }; 
     char content[]="Content-type: image/png\n\n";
     int i;
-    /* write mime-type to stout */ 
+    /* write mime-type to stdout */ 
     write(STDOUT_FILENO, content, strlen(content));
     /* execute chain of command */
     for (i=0; i<4; i++) {
@@ -78,18 +76,10 @@ int main(int argc, char *argv[], char *envp[])
     pipein = popen("barcode", "w");
     /* send barcode string to barcode program */
     write(fileno(pipein), argv[1], strlen(argv[1]));
+    pclose(pipein);
     /* close all pipes (in reverse order) */
     for (i=4; i==0; i--) {
        pclose((pipe[i]));
     }
     exit(0);
 }
-/*
- * Routine to produce an HTML error message on output 
- */
-void WriteMess(char *mess)
-{
-    printf("Content-type: text/html\n\n");
-    perror(mess);
-    printf("<br>\n");
-}