From: Kevin M. Rosenberg Date: Thu, 11 May 2000 01:06:30 +0000 (+0000) Subject: r49: Changed sprintf to snprintf X-Git-Tag: debian-4.5.3-3~968 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=c50886476dddf65aa71d519509b42f71303a149a r49: Changed sprintf to snprintf --- diff --git a/src/Makefile.am b/src/Makefile.am index 32ca90c..070099d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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@ diff --git a/src/ctrec.c b/src/ctrec.c index 8015376..1843d31 100644 --- a/src/ctrec.c +++ b/src/ctrec.c @@ -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) diff --git a/src/phm2sdf.c b/src/phm2sdf.c index 7da5c48..f87e5ac 100644 --- a/src/phm2sdf.c +++ b/src/phm2sdf.c @@ -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) diff --git a/src/sdf-2.c b/src/sdf-2.c index 4dc323f..89e9bf4 100644 --- a/src/sdf-2.c +++ b/src/sdf-2.c @@ -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); }