r49: Changed sprintf to snprintf
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 11 May 2000 01:06:30 +0000 (01:06 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 11 May 2000 01:06:30 +0000 (01:06 +0000)
src/Makefile.am
src/ctrec.c
src/phm2sdf.c
src/sdf-2.c

index 32ca90cbb25aacffd92a719a291ff46e8036099a..070099d999b7d9f1f0da667027b13e842c31c1a5 100644 (file)
@@ -2,6 +2,7 @@ bin_PROGRAMS = sdf2img ctrec phm2rs phm2sdf rs2sdf sdf-1 sdf-2 sdfinfo @lamprogr
 bin_SCRIPTS = sample-ctrec.sh
 EXTRA_PROGRAMS = ctrec-lam phm2sdf-lam phm2rs-lam
 INCLUDES=@my_includes@
+EXTRA_DIST=Makefile.nt
 
 ctrec_SOURCES = ctrec.c 
 ctrec_LDADD=@ctlibs@
index 8015376fff4d3b40507276b68131f560df48181c..1843d3123f48b2721a2b1280fe1150cb057e7f5d 100644 (file)
@@ -2,8 +2,11 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ctrec.c,v 1.9 2000/05/08 20:02:32 kevin Exp $
+**  $Id: ctrec.c,v 1.10 2000/05/11 01:06:30 kevin Exp $
 **  $Log: ctrec.c,v $
+**  Revision 1.10  2000/05/11 01:06:30  kevin
+**  Changed sprintf to snprintf
+**
 **  Revision 1.9  2000/05/08 20:02:32  kevin
 **  ANSI C changes
 **
@@ -241,12 +244,12 @@ main (const int argc, char *const argv[])
     ny = strtol(argv[optind + 3], &endptr, 10);
   
     if (opt_filter == FILTER_G_HAMMING || opt_filter == FILTER_ABS_G_HAMMING)
-      sprintf (filt_name, "%s: alpha = %.2f",
+      snprintf (filt_name, sizeof(filt_name), "%s: alpha = %.2f",
               name_of_filter (opt_filter), opt_filter_param); 
     else
-      sprintf (filt_name, "%s", name_of_filter (opt_filter));
+      snprintf (filt_name, sizeof(filt_name), "%s", name_of_filter (opt_filter));
   
-    sprintf (remark, "Reconstruct: %dx%d, %s, %s, %s",
+    snprintf (remark, sizeof(remark), "Reconstruct: %dx%d, %s, %s, %s",
             nx, ny, filt_name, name_of_interpolation (opt_interp), name_of_backproj(opt_backproj));
   
     if (opt_verbose)
index 7da5c48161aebb643f45abac563096f8efa18232..f87e5acee06807cc17d558e3a716796ef6ce23c5 100644 (file)
@@ -2,8 +2,11 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: phm2sdf.c,v 1.7 2000/05/08 20:02:32 kevin Exp $
+**  $Id: phm2sdf.c,v 1.8 2000/05/11 01:06:30 kevin Exp $
 **  $Log: phm2sdf.c,v $
+**  Revision 1.8  2000/05/11 01:06:30  kevin
+**  Changed sprintf to snprintf
+**
 **  Revision 1.7  2000/05/08 20:02:32  kevin
 **  ANSI C changes
 **
@@ -344,9 +347,10 @@ main (const int argc, char *const argv[])
 #else
   im_global = image_create (opt_outfile, opt_nx, opt_ny);
 #endif
-  
-  if (opt_phmnum > 0)
-    phm = phm_create (opt_phmnum);
+
+  if (opt_phmnum >= 0)
+      phm = phm_create (opt_phmnum);
+
 #ifdef MPI_CT
   else {
     if (mpi_ct.my_rank == 0)
index 4dc323fc169a347071c1a4f335abbb005de7f390..89e9bf41f205f693335d8c0ef9324a9a9938fe7e 100644 (file)
@@ -2,8 +2,11 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: sdf-2.c,v 1.2 2000/05/08 20:02:32 kevin Exp $
+**  $Id: sdf-2.c,v 1.3 2000/05/11 01:06:30 kevin Exp $
 **  $Log: sdf-2.c,v $
+**  Revision 1.3  2000/05/11 01:06:30  kevin
+**  Changed sprintf to snprintf
+**
 **  Revision 1.2  2000/05/08 20:02:32  kevin
 **  ANSI C changes
 **
@@ -59,7 +62,7 @@ usage (const char *program)
   fprintf(stdout, "     --mul      Multiply images\n");
   fprintf(stdout, "     --comp     Compare images\n");
   fprintf(stdout, "     --verbose  Verbose modem\n");
-  fprintf(stdout,     --version  Print version\n");
+  fprintf(stdout, "     --version  Print version\n");
   fprintf(stdout, "     --help     Print this help message\n");
   exit(1);
 }