|
From: <kin...@us...> - 2023-07-07 21:14:43
|
Revision: 7038
http://sourceforge.net/p/teem/code/7038
Author: kindlmann
Date: 2023-07-07 21:14:40 +0000 (Fri, 07 Jul 2023)
Log Message:
-----------
Propagating recent AIR_STRLEN --> AIR_STRLEN+1 change, which leads to API CHANGEs:
In these structs' elements' sizes:
NrrdFormat:
char name[AIR_STRLEN_SMALL + 1]; /* short identifying string */
NrrdEncoding:
char name[AIR_STRLEN_SMALL + 1], /* short identifying string */
suffix[AIR_STRLEN_SMALL + 1]; /* customary filename suffix */
NrrdKernel:
char name[AIR_STRLEN_SMALL + 1];
and in these function parameters:
const char nrrdTypePrintfStr[NRRD_TYPE_MAX + 1][AIR_STRLEN_SMALL + 1];
int nrrdBoundarySpecSprint(char str[AIR_STRLEN_LARGE + 1],
const NrrdBoundarySpec *bspec);
int nrrdBoundarySpecCompare(const NrrdBoundarySpec *bspecA,
const NrrdBoundarySpec *bspecB,
int *differ, char explain[AIR_STRLEN_LARGE + 1]);
int nrrdCompare(const Nrrd *ninA, const Nrrd *ninB, int onlyData,
double epsilon, int *differ,
char explain[AIR_STRLEN_LARGE + 1]);
int nrrdAxisInfoCompare(const NrrdAxisInfo *axisA,
const NrrdAxisInfo *axisB,
int *differ,
char explain[AIR_STRLEN_LARGE + 1]);
int nrrdArrayCompare(int type, const void *valA, const void *valB,
size_t valNum, double epsilon, int *differ,
char explain[AIR_STRLEN_LARGE + 1]);
int nrrdKernelSpecSprint(char str[AIR_STRLEN_LARGE + 1],
const NrrdKernelSpec *ksp);
int nrrdKernelSprint(char str[AIR_STRLEN_LARGE + 1],
const NrrdKernel *kernel,
const double kparm[NRRD_KERNEL_PARMS_NUM]);
int nrrdKernelCompare(const NrrdKernel *kernA,
const double parmA[NRRD_KERNEL_PARMS_NUM],
const NrrdKernel *kernB,
const double parmB[NRRD_KERNEL_PARMS_NUM],
int *differ,
char explain[AIR_STRLEN_LARGE + 1]);
int nrrdKernelSpecCompare(const NrrdKernelSpec *aa,
const NrrdKernelSpec *bb,
int *differ,
char explain[AIR_STRLEN_LARGE + 1]);
Modified Paths:
--------------
teem/trunk/src/nrrd/accessors.c
teem/trunk/src/nrrd/apply1D.c
teem/trunk/src/nrrd/apply2D.c
teem/trunk/src/nrrd/arraysNrrd.c
teem/trunk/src/nrrd/axis.c
teem/trunk/src/nrrd/deringNrrd.c
teem/trunk/src/nrrd/encodingAscii.c
teem/trunk/src/nrrd/encodingBzip2.c
teem/trunk/src/nrrd/encodingGzip.c
teem/trunk/src/nrrd/encodingHex.c
teem/trunk/src/nrrd/encodingRaw.c
teem/trunk/src/nrrd/formatEPS.c
teem/trunk/src/nrrd/formatNRRD.c
teem/trunk/src/nrrd/formatPNG.c
teem/trunk/src/nrrd/formatPNM.c
teem/trunk/src/nrrd/formatText.c
teem/trunk/src/nrrd/formatVTK.c
teem/trunk/src/nrrd/gzio.c
teem/trunk/src/nrrd/hestNrrd.c
teem/trunk/src/nrrd/histogram.c
teem/trunk/src/nrrd/iter.c
teem/trunk/src/nrrd/kernel.c
teem/trunk/src/nrrd/map.c
teem/trunk/src/nrrd/measure.c
teem/trunk/src/nrrd/methodsNrrd.c
teem/trunk/src/nrrd/nrrd.h
teem/trunk/src/nrrd/parseNrrd.c
teem/trunk/src/nrrd/read.c
teem/trunk/src/nrrd/reorder.c
teem/trunk/src/nrrd/resampleContext.c
teem/trunk/src/nrrd/resampleNrrd.c
teem/trunk/src/nrrd/simple.c
teem/trunk/src/nrrd/subset.c
teem/trunk/src/nrrd/superset.c
teem/trunk/src/nrrd/test/convo.c
teem/trunk/src/nrrd/test/tkernel.c
teem/trunk/src/nrrd/test/typestest.c
teem/trunk/src/nrrd/write.c
Modified: teem/trunk/src/nrrd/accessors.c
===================================================================
--- teem/trunk/src/nrrd/accessors.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/accessors.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -516,12 +516,12 @@
int /* Biff: 1 */
nrrdArrayCompare(int type, const void *_valA, const void *_valB,
size_t valNum, double epsilon, int *differ,
- char explain[AIR_STRLEN_LARGE]) {
+ char explain[AIR_STRLEN_LARGE+1]) {
static const char me[] = "nrrdArrayCompare";
const unsigned char *valA, *valB;
int (*compare)(const void *, const void *);
size_t ii, sze;
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL+1];
if (!(_valA && _valB && differ)) {
biffAddf(NRRD, "%s: got NULL pointer (%p, %p, or %p)", me,
Modified: teem/trunk/src/nrrd/apply1D.c
===================================================================
--- teem/trunk/src/nrrd/apply1D.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/apply1D.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -87,12 +87,13 @@
int kind, int typeOut, int rescale, int multi) {
static const char me[] = "_nrrdApply1DSetUp";
char *mapcnt;
- char nounStr[][AIR_STRLEN_SMALL] = {"lut", "regular map", "irregular map"};
- char mnounStr[][AIR_STRLEN_SMALL] = {"multi lut", "multi regular map",
- "multi irregular map"};
+ char nounStr[][AIR_STRLEN_SMALL + 1] = {"lut", "regular map", "irregular map"};
+ char mnounStr[][AIR_STRLEN_SMALL + 1] = {"multi lut", "multi regular map",
+ "multi irregular map"};
/* wishful thinking */
- char verbStr[][AIR_STRLEN_SMALL] = {"lut", "rmap", "imap"};
- char mverbStr[][AIR_STRLEN_SMALL] = {"mlut", "mrmap", "mimap"}; /* wishful thinking */
+ char verbStr[][AIR_STRLEN_SMALL + 1] = {"lut", "rmap", "imap"};
+ char mverbStr[][AIR_STRLEN_SMALL + 1] = {"mlut", "mrmap",
+ "mimap"}; /* wishful thinking */
int mapAxis, copyMapAxis0 = AIR_FALSE, axisMap[NRRD_DIM_MAX];
unsigned int ax, dim, entLen;
size_t size[NRRD_DIM_MAX];
@@ -154,13 +155,13 @@
return 1;
}
if (nin->axis[ax].size != nmap->axis[taxi].size) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
biffAddf(NRRD,
"%s: input and mmap don't have compatible sizes: "
"nin->axis[%d].size (%s) "
"!= nmap->axis[%d].size (%s): ",
- me, ax, airSprintSize_t(stmp1, nin->axis[ax].size), mapAxis + 1 + ax,
- airSprintSize_t(stmp2, nmap->axis[taxi].size));
+ me, ax, airSprintSize_t(stmp[0], nin->axis[ax].size),
+ mapAxis + 1 + ax, airSprintSize_t(stmp[1], nmap->axis[taxi].size));
return 1;
}
}
@@ -701,10 +702,10 @@
return 1;
}
if (!(nacl->axis[0].size == 2 && nacl->axis[1].size >= 2)) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: sizes (%s,%s) not (2,>=2)", me,
- airSprintSize_t(stmp1, nacl->axis[0].size),
- airSprintSize_t(stmp2, nacl->axis[1].size));
+ airSprintSize_t(stmp[0], nacl->axis[0].size),
+ airSprintSize_t(stmp[1], nacl->axis[1].size));
return 1;
}
@@ -824,7 +825,7 @@
return 1;
}
if (!(aclLen >= 2)) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: given acl length (%s) is too small", me,
airSprintSize_t(stmp, aclLen));
return 1;
Modified: teem/trunk/src/nrrd/apply2D.c
===================================================================
--- teem/trunk/src/nrrd/apply2D.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/apply2D.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -46,8 +46,8 @@
int rescale0, int rescale1) {
static const char me[] = "_nrrdApply2DSetUp";
char *mapcnt;
- char nounStr[][AIR_STRLEN_SMALL] = {"2D lut", "2D regular map"};
- char verbStr[][AIR_STRLEN_SMALL] = {"lut2", "rmap2"};
+ char nounStr[][AIR_STRLEN_SMALL + 1] = {"2D lut", "2D regular map"};
+ char verbStr[][AIR_STRLEN_SMALL + 1] = {"lut2", "rmap2"};
int mapAxis, copyMapAxis0 = AIR_FALSE, axisMap[NRRD_DIM_MAX];
unsigned int dim, entLen;
size_t size[NRRD_DIM_MAX];
@@ -67,7 +67,7 @@
return 1;
}
if (!(2 == nin->axis[0].size)) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: input axis[0] must have size 2 (not %s)", me,
airSprintSize_t(stmp, nin->axis[0].size));
return 1;
Modified: teem/trunk/src/nrrd/arraysNrrd.c
===================================================================
--- teem/trunk/src/nrrd/arraysNrrd.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/arraysNrrd.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -26,7 +26,7 @@
const int blah[] array in an object file if it hasn't been declared
as "extern" */
-const char nrrdTypePrintfStr[NRRD_TYPE_MAX + 1][AIR_STRLEN_SMALL] = {
+const char nrrdTypePrintfStr[NRRD_TYPE_MAX + 1][AIR_STRLEN_SMALL + 1] = {
"%*d", /* nrrdTypeUnknown: what else? the effect will be
"skip" for sscanf, and "minimum precision" for printf */
"%d", /* nrrdTypeChar: char */
Modified: teem/trunk/src/nrrd/axis.c
===================================================================
--- teem/trunk/src/nrrd/axis.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/axis.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -927,7 +927,7 @@
*/
int /* Biff: 1 */
nrrdAxisInfoCompare(const NrrdAxisInfo *axisA, const NrrdAxisInfo *axisB, int *differ,
- char explain[AIR_STRLEN_LARGE]) {
+ char explain[AIR_STRLEN_LARGE + 1]) {
static const char me[] = "nrrdAxisInfoCompare";
unsigned int saxi;
@@ -941,12 +941,12 @@
strcpy(explain, "");
}
if (axisA->size != axisB->size) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
*differ = axisA->size < axisB->size ? -1 : 1;
if (explain) {
sprintf(explain, "axisA->size=%s %s axisB->size=%s",
- airSprintSize_t(stmp1, axisA->size), *differ < 0 ? "<" : ">",
- airSprintSize_t(stmp2, axisB->size));
+ airSprintSize_t(stmp[0], axisA->size), *differ < 0 ? "<" : ">",
+ airSprintSize_t(stmp[1], axisB->size));
}
return 0;
}
@@ -966,7 +966,7 @@
DOUBLE_COMPARE(min, "min");
DOUBLE_COMPARE(max, "max");
for (saxi = 0; saxi < NRRD_SPACE_DIM_MAX; saxi++) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
sprintf(stmp, "spaceDirection[%u]", saxi);
DOUBLE_COMPARE(spaceDirection[saxi], stmp);
}
@@ -997,7 +997,7 @@
sprintf(explain, "axisA->label %s axisB->label", *differ < 0 ? "<" : ">");
if (strlen(explain) + airStrlen(axisA->label) + airStrlen(axisB->label)
+ 2 * strlen(" \"\" ") + 1
- < AIR_STRLEN_LARGE) {
+ < AIR_STRLEN_LARGE + 1) {
/* ok, we can print them */
sprintf(explain, "axisA->label \"%s\" %s axisB->label \"%s\"",
axisA->label ? axisA->label : "", *differ < 0 ? "<" : ">",
Modified: teem/trunk/src/nrrd/deringNrrd.c
===================================================================
--- teem/trunk/src/nrrd/deringNrrd.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/deringNrrd.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -398,7 +398,7 @@
E = AIR_FALSE;
for (ri = 0; ri < 2; ri++) {
- char kstr[AIR_STRLEN_LARGE];
+ char kstr[AIR_STRLEN_LARGE + 1];
if (0 == ri) {
if (!E) E |= nrrdResampleInputSet(dbg->rsmc[0], dbg->nptxf[ORIG]);
nrrdKernelSprint(kstr, drc->rkernel, drc->rkparm);
@@ -570,7 +570,7 @@
}
}
if (DEBUG) {
- char fname[AIR_STRLEN_SMALL];
+ char fname[AIR_STRLEN_SMALL + 1];
sprintf(fname, "wght-%02u.nrrd", dbg->zi);
nrrdSave(fname, dbg->nptxf[WGHT], NULL);
}
@@ -619,7 +619,7 @@
return 1;
}
if (DEBUG) {
- char fn[AIR_STRLEN_SMALL];
+ char fn[AIR_STRLEN_SMALL + 1];
sprintf(fn, "rshp-%02u.nrrd", dbg->zi);
nrrdSave(fn, dbg->nptxf[RSHP], NULL);
sprintf(fn, "crop-%02u.nrrd", dbg->zi);
@@ -627,7 +627,7 @@
}
}
if (DEBUG) {
- char fn[AIR_STRLEN_SMALL];
+ char fn[AIR_STRLEN_SMALL + 1];
sprintf(fn, "orig-%02u.nrrd", dbg->zi);
nrrdSave(fn, dbg->nptxf[ORIG], NULL);
sprintf(fn, "blrr-%02u.nrrd", dbg->zi);
@@ -695,7 +695,7 @@
}
}
if (DEBUG) {
- char fname[AIR_STRLEN_SMALL];
+ char fname[AIR_STRLEN_SMALL + 1];
sprintf(fname, "ring2-%02u.nrrd", dbg->zi);
nrrdSave(fname, dbg->nptxf[RING], NULL);
sprintf(fname, "drng-%02u.nrrd", dbg->zi);
Modified: teem/trunk/src/nrrd/encodingAscii.c
===================================================================
--- teem/trunk/src/nrrd/encodingAscii.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/encodingAscii.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -37,7 +37,7 @@
_nrrdEncodingAscii_read(FILE *file, void *_data, size_t elNum, Nrrd *nrrd,
NrrdIoState *nio) {
static const char me[] = "_nrrdEncodingAscii_read";
- char numbStr[AIR_STRLEN_HUGE]; /* HEY: fix this */
+ char numbStr[AIR_STRLEN_HUGE + 1]; /* HEY: fix this */
char *nstr;
size_t I;
char *data;
@@ -53,7 +53,7 @@
data = (char *)_data;
I = 0;
while (I < elNum) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
/* HEY: we can easily suffer here from a standard buffer overflow problem;
this was a source of a mysterious unu crash:
echo "0 0 0 0 1 0 0 0 0" \
@@ -63,10 +63,12 @@
-spc LPS -orig "(0,0,0)" -dirs "(1,0,0) (0,1,0) (0,0,1)"
This particular case is resolved by changing AIR_STRLEN_HUGE
to AIR_STRLEN_HUGE*100, but the general problem remains. This
- motivated adding the memory corruption test */
+ motivated adding the memory corruption test
+ HEY HEY: 2023 GLK does not know what buffer AIR_STRLEN_HUGE*100
+ could be describing; what was this?? */
if (1 != fscanf(file, "%s", numbStr)) {
biffAddf(NRRD, "%s: couldn't parse element %s of %s", me,
- airSprintSize_t(stmp1, I + 1), airSprintSize_t(stmp2, elNum));
+ airSprintSize_t(stmp[0], I + 1), airSprintSize_t(stmp[1], elNum));
return 1;
}
/*
@@ -89,8 +91,8 @@
!= airSingleSscanf(nstr, nrrdTypePrintfStr[nrrd->type],
(void *)(data + I * nrrdElementSize(nrrd)))) {
biffAddf(NRRD, "%s: couldn't parse %s %s of %s (\"%s\")", me,
- airEnumStr(nrrdType, nrrd->type), airSprintSize_t(stmp1, I + 1),
- airSprintSize_t(stmp2, elNum), nstr);
+ airEnumStr(nrrdType, nrrd->type), airSprintSize_t(stmp[0], I + 1),
+ airSprintSize_t(stmp[1], elNum), nstr);
return 1;
}
} else {
@@ -97,7 +99,7 @@
/* sscanf value into an int first */
if (1 != airSingleSscanf(nstr, "%d", &tmp)) {
biffAddf(NRRD, "%s: couldn't parse element %s of %s (\"%s\")", me,
- airSprintSize_t(stmp1, I + 1), airSprintSize_t(stmp2, elNum), nstr);
+ airSprintSize_t(stmp[0], I + 1), airSprintSize_t(stmp[1], elNum), nstr);
return 1;
}
nrrdIInsert[nrrd->type](data, I, tmp);
@@ -112,7 +114,7 @@
_nrrdEncodingAscii_write(FILE *file, const void *_data, size_t elNum, const Nrrd *nrrd,
NrrdIoState *nio) {
static const char me[] = "_nrrdEncodingAscii_write";
- char buff[AIR_STRLEN_MED];
+ char buff[AIR_STRLEN_MED + 1];
size_t bufflen, linelen;
const char *data;
size_t I;
Modified: teem/trunk/src/nrrd/encodingBzip2.c
===================================================================
--- teem/trunk/src/nrrd/encodingBzip2.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/encodingBzip2.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -117,9 +117,9 @@
/* Check to see if we got out as much as we thought we should. */
if (total_read != bsize) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: expected %s bytes but received %s", me,
- airSprintSize_t(stmp1, bsize), airSprintSize_t(stmp2, total_read));
+ airSprintSize_t(stmp[0], bsize), airSprintSize_t(stmp[1], total_read));
return 1;
}
@@ -209,9 +209,9 @@
/* Check to see if we got out as much as we thought we should. */
if (total_written != bsize) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: expected to write %s bytes, but only wrote %s", me,
- airSprintSize_t(stmp1, bsize), airSprintSize_t(stmp2, total_written));
+ airSprintSize_t(stmp[0], bsize), airSprintSize_t(stmp[1], total_written));
return 1;
}
Modified: teem/trunk/src/nrrd/encodingGzip.c
===================================================================
--- teem/trunk/src/nrrd/encodingGzip.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/encodingGzip.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -128,10 +128,10 @@
/* backwards is (positive) number of bytes AFTER data that we ignore */
backwards = -nio->byteSkip - 1;
if (sizeRed < sizeData + AIR_CAST(size_t, backwards)) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: expected %s bytes but received only %s", me,
- airSprintSize_t(stmp1, sizeData + AIR_CAST(size_t, backwards)),
- airSprintSize_t(stmp2, sizeRed));
+ airSprintSize_t(stmp[0], sizeData + AIR_CAST(size_t, backwards)),
+ airSprintSize_t(stmp[1], sizeRed));
return 1;
}
/* also handles nio->byteSkip == -N-1 signifying extra N bytes at end */
@@ -171,9 +171,9 @@
}
/* Check to see if we got out as much as we thought we should. */
if (sizeRed != sizeData) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: expected %s bytes but received %s", me,
- airSprintSize_t(stmp1, sizeData), airSprintSize_t(stmp2, sizeRed));
+ airSprintSize_t(stmp[0], sizeData), airSprintSize_t(stmp[1], sizeRed));
return 1;
}
}
@@ -267,9 +267,9 @@
/* Check to see if we wrote out as much as we thought we should. */
if (sizeWrit != sizeData) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: expected to write %s bytes, but only wrote %s", me,
- airSprintSize_t(stmp1, sizeData), airSprintSize_t(stmp2, sizeWrit));
+ airSprintSize_t(stmp[0], sizeData), airSprintSize_t(stmp[1], sizeWrit));
return 1;
}
Modified: teem/trunk/src/nrrd/encodingHex.c
===================================================================
--- teem/trunk/src/nrrd/encodingHex.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/encodingHex.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -93,16 +93,17 @@
nibIdx++;
}
if (nibIdx != nibNum) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
if (EOF == car) {
biffAddf(NRRD, "%s: hit EOF getting byte %s of %s", me,
- airSprintSize_t(stmp1, nibIdx / 2), airSprintSize_t(stmp2, nibNum / 2));
+ airSprintSize_t(stmp[0], nibIdx / 2),
+ airSprintSize_t(stmp[1], nibNum / 2));
} else {
biffAddf(NRRD,
"%s: hit invalid character ('%c') getting "
"byte %s of %s",
- me, car, airSprintSize_t(stmp1, nibIdx / 2),
- airSprintSize_t(stmp2, nibNum / 2));
+ me, car, airSprintSize_t(stmp[0], nibIdx / 2),
+ airSprintSize_t(stmp[1], nibNum / 2));
}
return 1;
}
Modified: teem/trunk/src/nrrd/encodingRaw.c
===================================================================
--- teem/trunk/src/nrrd/encodingRaw.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/encodingRaw.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -38,7 +38,7 @@
char *data_c;
size_t elementSize, maxChunkSize, remainderValue, chunkSize;
size_t retTmp;
- char stmp[3][AIR_STRLEN_SMALL];
+ char stmp[3][AIR_STRLEN_SMALL + 1];
bsize = nrrdElementSize(nrrd) * elementNum;
if (nio->format->usesDIO) {
@@ -130,7 +130,7 @@
const char *data_c;
size_t elementSize, maxChunkSize, remainderValue, chunkSize;
size_t retTmp;
- char stmp[3][AIR_STRLEN_SMALL];
+ char stmp[3][AIR_STRLEN_SMALL + 1];
bsize = nrrdElementSize(nrrd) * elementNum;
if (nio->format->usesDIO) {
Modified: teem/trunk/src/nrrd/formatEPS.c
===================================================================
--- teem/trunk/src/nrrd/formatEPS.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/formatEPS.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -66,7 +66,7 @@
ret = 3;
} else {
/* else its no good */
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffMaybeAddf(useBiff, NRRD,
"%s: dim is 3, but 1st axis size is %s, not 1, 3, or 4", me,
airSprintSize_t(stmp, nrrd->axis[0].size));
Modified: teem/trunk/src/nrrd/formatNRRD.c
===================================================================
--- teem/trunk/src/nrrd/formatNRRD.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/formatNRRD.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -599,7 +599,7 @@
static int /* Biff: 1 */
_nrrdFormatNRRD_write(FILE *file, const Nrrd *nrrd, NrrdIoState *nio) {
static const char me[] = "_nrrdFormatNRRD_write";
- char strbuf[AIR_STRLEN_MED], *strptr, *tmp;
+ char strbuf[AIR_STRLEN_MED + 1], *strptr, *tmp;
int ii;
unsigned int jj;
airArray *mop;
Modified: teem/trunk/src/nrrd/formatPNG.c
===================================================================
--- teem/trunk/src/nrrd/formatPNG.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/formatPNG.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -81,7 +81,7 @@
} else if (3 == nrrd->dim) {
if (!(1 == nrrd->axis[0].size || 2 == nrrd->axis[0].size || 3 == nrrd->axis[0].size
|| 4 == nrrd->axis[0].size)) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffMaybeAddf(useBiff, NRRD, "%s: 1st axis size is %s, not 1, 2, 3, or 4", me,
airSprintSize_t(stmp, nrrd->axis[0].size));
return AIR_FALSE;
@@ -161,7 +161,7 @@
int depth, type, i, channels, numtxt, ret;
int ntype, ndim;
size_t nsize[3];
- char stmp[6][AIR_STRLEN_SMALL];
+ char stmp[6][AIR_STRLEN_SMALL + 1];
#endif /* TEEM_PNG */
AIR_UNUSED(file);
@@ -474,7 +474,7 @@
/* calculate depth, width, height, and row size */
depth = nrrd->type == nrrdTypeUChar ? 8 : 16;
switch (nrrd->dim) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
case 2: /* g only */
width = AIR_CAST(png_uint_32, nrrd->axis[0].size);
height = AIR_CAST(png_uint_32, nrrd->axis[1].size);
Modified: teem/trunk/src/nrrd/formatPNM.c
===================================================================
--- teem/trunk/src/nrrd/formatPNM.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/formatPNM.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -71,7 +71,7 @@
ret = 3;
} else {
/* else its no good */
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffMaybeAddf(useBiff, NRRD, "%s: dim is 3, but 1st axis size is %s, not 1 or 3",
me, airSprintSize_t(stmp, nrrd->axis[0].size));
return AIR_FALSE;
Modified: teem/trunk/src/nrrd/formatText.c
===================================================================
--- teem/trunk/src/nrrd/formatText.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/formatText.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -184,7 +184,7 @@
For the specific purpose of counting numbers, we assume float type;
but we aren't going to remember these values. */
if (!airParseStrF(&oneFloat, nio->line, _nrrdTextSep, 1)) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: couldn't parse a single number on line %s", me,
airSprintSize_t(stmp, line));
UNSETTWO;
@@ -201,7 +201,7 @@
be parsed from a single finite line of input text */
airArrayLenSet(flArr, AIR_UINT(sx));
if (!flArr->data) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: couldn't alloc space for %s values", me,
airSprintSize_t(stmp, sx));
UNSETTWO;
@@ -217,7 +217,7 @@
}
flArr = airArrayNuke(flArr); /* forget about values parsed on 1st line */
if (1 == nrrd->dim && 1 != sx) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: wanted 1-D nrrd, but got %s values on 1st line", me,
airSprintSize_t(stmp, sx));
UNSETTWO;
@@ -260,7 +260,7 @@
while (llen) {
airArrayLenIncr(dataArr, 1);
if (!dataArr->data) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: couldn't create scanline of %s values", me,
airSprintSize_t(stmp, sx));
UNSETTWO;
@@ -268,10 +268,10 @@
}
plen = parser(data + sy * sx * elsz, nio->line, _nrrdTextSep, sx);
if (sx > plen) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL], stmp3[AIR_STRLEN_SMALL];
+ char stmp[3][AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: could only parse %s values (not %s) on line %s", me,
- airSprintSize_t(stmp1, plen), airSprintSize_t(stmp2, sx),
- airSprintSize_t(stmp3, line));
+ airSprintSize_t(stmp[0], plen), airSprintSize_t(stmp[1], sx),
+ airSprintSize_t(stmp[2], line));
UNSETTWO;
return 1;
}
@@ -317,7 +317,7 @@
static int
_nrrdFormatText_write(FILE *file, const Nrrd *nrrd, NrrdIoState *nio) {
- char cmt[AIR_STRLEN_SMALL], buff[AIR_STRLEN_SMALL];
+ char cmt[AIR_STRLEN_SMALL + 1], buff[AIR_STRLEN_SMALL + 1];
size_t I, dsz;
int i, x, y, sx, sy;
const void *data;
Modified: teem/trunk/src/nrrd/formatVTK.c
===================================================================
--- teem/trunk/src/nrrd/formatVTK.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/formatVTK.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -275,7 +275,7 @@
int i, sax;
unsigned int sx, sy, sz;
double xs, ys, zs, xm, ym, zm;
- char type[AIR_STRLEN_MED], name[AIR_STRLEN_SMALL];
+ char type[AIR_STRLEN_MED + 1], name[AIR_STRLEN_SMALL + 1];
Nrrd *nrrd;
airArray *mop;
Modified: teem/trunk/src/nrrd/gzio.c
===================================================================
--- teem/trunk/src/nrrd/gzio.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/gzio.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -161,7 +161,7 @@
int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
const char *p = mode;
_NrrdGzStream *s;
- char fmode[AIR_STRLEN_MED]; /* copy of mode, without the compression level */
+ char fmode[AIR_STRLEN_MED + 1]; /* copy of mode, without the compression level */
char *m = fmode;
if (!mode) {
Modified: teem/trunk/src/nrrd/hestNrrd.c
===================================================================
--- teem/trunk/src/nrrd/hestNrrd.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/hestNrrd.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -33,7 +33,7 @@
** that is just fine
*/
static int
-_nrrdHestNrrdParse(void *ptr, const char *str, char err[AIR_STRLEN_HUGE]) {
+_nrrdHestNrrdParse(void *ptr, const char *str, char err[AIR_STRLEN_HUGE + 1]) {
static const char me[] = "_nrrdHestNrrdParse";
char *nerr;
Nrrd **nrrdP;
@@ -50,7 +50,7 @@
airMopAdd(mop, *nrrdP, (airMopper)nrrdNuke, airMopOnError);
if (nrrdLoad(*nrrdP, str, NULL)) {
airMopAdd(mop, nerr = biffGetDone(NRRD), airFree, airMopOnError);
- airStrcpy(err, AIR_STRLEN_HUGE, nerr);
+ airStrcpy(err, AIR_STRLEN_HUGE + 1, nerr);
airMopError(mop);
return (strstr(err, "EOF") ? 2 : 1);
}
@@ -71,7 +71,7 @@
/* ------------------------ NrrdKernelSpec -------------------------- */
static int
-_nrrdHestKernelSpecParse(void *ptr, const char *str, char err[AIR_STRLEN_HUGE]) {
+_nrrdHestKernelSpecParse(void *ptr, const char *str, char err[AIR_STRLEN_HUGE + 1]) {
NrrdKernelSpec **ksP;
static const char me[] = "_nrrdHestKernelSpecParse";
char *nerr;
@@ -84,7 +84,7 @@
*ksP = nrrdKernelSpecNew();
if (nrrdKernelParse(&((*ksP)->kernel), (*ksP)->parm, str)) {
nerr = biffGetDone(NRRD);
- airStrcpy(err, AIR_STRLEN_HUGE, nerr);
+ airStrcpy(err, AIR_STRLEN_HUGE + 1, nerr);
free(nerr);
return 1;
}
@@ -101,7 +101,7 @@
/* ------------------------ NrrdBoundarySpec -------------------------- */
static int
-_nrrdHestBoundarySpecParse(void *ptr, const char *str, char err[AIR_STRLEN_HUGE]) {
+_nrrdHestBoundarySpecParse(void *ptr, const char *str, char err[AIR_STRLEN_HUGE + 1]) {
NrrdBoundarySpec **bsp;
static const char me[] = "_nrrdHestBoundarySpecParse";
char *nerr;
@@ -114,7 +114,7 @@
*bsp = nrrdBoundarySpecNew();
if (nrrdBoundarySpecParse(*bsp, str)) {
nerr = biffGetDone(NRRD);
- airStrcpy(err, AIR_STRLEN_HUGE, nerr);
+ airStrcpy(err, AIR_STRLEN_HUGE + 1, nerr);
/* HEY: why not freeing bsp? */
free(nerr);
return 1;
@@ -183,7 +183,7 @@
}
static int
-_nrrdHestIterParse(void *ptr, const char *str, char err[AIR_STRLEN_HUGE]) {
+_nrrdHestIterParse(void *ptr, const char *str, char err[AIR_STRLEN_HUGE + 1]) {
static const char me[] = "_nrrdHestIterParse";
char *nerr;
Nrrd *nrrd;
@@ -228,7 +228,7 @@
if (2 != ret) {
/* it failed because of something besides the fopen(), so complain */
nerr = biffGetDone(NRRD);
- airStrcpy(err, AIR_STRLEN_HUGE, nerr);
+ airStrcpy(err, AIR_STRLEN_HUGE + 1, nerr);
airMopError(mop);
return 1;
} else {
@@ -253,7 +253,7 @@
we'll let it fail again and pass back the error messages */
if (nrrdLoad(nrrd = nrrdNew(), str, NULL)) {
nerr = biffGetDone(NRRD);
- airStrcpy(err, AIR_STRLEN_HUGE, nerr);
+ airStrcpy(err, AIR_STRLEN_HUGE + 1, nerr);
airMopError(mop);
return 1;
} else {
Modified: teem/trunk/src/nrrd/histogram.c
===================================================================
--- teem/trunk/src/nrrd/histogram.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/histogram.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -55,7 +55,7 @@
return 1;
}
if (!(bins > 0)) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: bins value (%s) invalid", me, airSprintSize_t(stmp, bins));
return 1;
}
@@ -83,7 +83,7 @@
}
if (nrrdMaybeAlloc_va(nout, type, 1, bins)) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: failed to alloc histo array (len %s)", me,
airSprintSize_t(stmp, bins));
return 1;
@@ -188,7 +188,7 @@
int /* Biff: 1 */
nrrdHistoDraw(Nrrd *nout, const Nrrd *nin, size_t sy, int showLog, double max) {
static const char me[] = "nrrdHistoDraw", func[] = "dhisto";
- char cmt[AIR_STRLEN_MED], stmp[AIR_STRLEN_SMALL];
+ char cmt[AIR_STRLEN_MED + 1], stmp[AIR_STRLEN_SMALL + 1];
unsigned int ki, numticks, *linY, *logY, tick, *ticks;
double hits, maxhits, usemaxhits;
unsigned char *pgmData;
@@ -343,7 +343,7 @@
return 1;
}
if (!(bins > 0)) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: bins value (%s) invalid", me, airSprintSize_t(stmp, bins));
return 1;
}
@@ -501,7 +501,7 @@
return 1;
}
if (!(bins[ai] >= 1)) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: need bins[%u] >= 1 (not %s)", me, ai,
airSprintSize_t(stmp, bins[ai]));
return 1;
@@ -514,7 +514,7 @@
/* check nwght */
if (nwght) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
if (nout == nwght) {
biffAddf(NRRD, "%s: nout==nwght disallowed", me);
return 1;
@@ -526,8 +526,8 @@
}
if (nrrdElementNumber(nin[0]) != nrrdElementNumber(nwght)) {
biffAddf(NRRD, "%s: element # in nwght %s != nin[0] %s", me,
- airSprintSize_t(stmp2, nrrdElementNumber(nin[0])),
- airSprintSize_t(stmp1, nrrdElementNumber(nwght)));
+ airSprintSize_t(stmp[0], nrrdElementNumber(nin[0])),
+ airSprintSize_t(stmp[1], nrrdElementNumber(nwght)));
return 1;
}
lup = nrrdDLookup[nwght->type];
@@ -558,7 +558,7 @@
nout->axis[ai].label
= AIR_CALLOC(strlen("histo(,)") + strlen(nin[ai]->content) + 11 + 1, char);
if (nout->axis[ai].label) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
sprintf(nout->axis[ai].label, "histo(%s,%s)", nin[ai]->content,
airSprintSize_t(stmp, bins[ai]));
} else {
Modified: teem/trunk/src/nrrd/iter.c
===================================================================
--- teem/trunk/src/nrrd/iter.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/iter.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -125,7 +125,7 @@
*/
char * /* Biff: nope */
nrrdIterContent(NrrdIter *iter) {
- char *ret, buff[AIR_STRLEN_SMALL];
+ char *ret, buff[AIR_STRLEN_SMALL + 1];
ret = NULL;
if (iter) {
Modified: teem/trunk/src/nrrd/kernel.c
===================================================================
--- teem/trunk/src/nrrd/kernel.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/kernel.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -3031,8 +3031,8 @@
int /* Biff: 1 */
nrrdKernelParse(const NrrdKernel **kernelP, double *parm, const char *_str) {
static const char me[] = "nrrdKernelParse";
- char str[AIR_STRLEN_HUGE], kstr[AIR_STRLEN_MED], *_pstr = NULL, *pstr,
- *tmfStr[4] = {NULL, NULL, NULL, NULL};
+ char str[AIR_STRLEN_HUGE + 1], kstr[AIR_STRLEN_MED + 1],
+ *_pstr = NULL, *pstr, *tmfStr[4] = {NULL, NULL, NULL, NULL};
int tmfD, tmfC, tmfA;
unsigned int jj, haveParm, needParm;
airArray *mop;
@@ -3051,7 +3051,7 @@
parm[jj] = 0;
}
- airStrcpy(str, AIR_STRLEN_HUGE, _str);
+ airStrcpy(str, AIR_STRLEN_HUGE + 1, _str);
strcpy(kstr, "");
pstr = NULL;
pstr = strchr(str, ':');
@@ -3231,10 +3231,10 @@
** which is plenty big
*/
int /* Biff: 1 */
-nrrdKernelSpecSprint(char str[AIR_STRLEN_LARGE], const NrrdKernelSpec *ksp) {
+nrrdKernelSpecSprint(char str[AIR_STRLEN_LARGE + 1], const NrrdKernelSpec *ksp) {
static const char me[] = "nrrdKernelSpecSprint";
unsigned int warnLen = AIR_STRLEN_LARGE / 3;
- char stmp[AIR_STRLEN_LARGE];
+ char stmp[AIR_STRLEN_LARGE + 1];
if (!(str && ksp)) {
biffAddf(NRRD, "%s: got NULL pointer", me);
@@ -3286,7 +3286,7 @@
}
int /* Biff: 1 */
-nrrdKernelSprint(char str[AIR_STRLEN_LARGE], const NrrdKernel *kernel,
+nrrdKernelSprint(char str[AIR_STRLEN_LARGE + 1], const NrrdKernel *kernel,
const double kparm[NRRD_KERNEL_PARMS_NUM]) {
static const char me[] = "nrrdKernelSprint";
NrrdKernelSpec ksp;
@@ -3306,7 +3306,7 @@
int /* Biff: 1 */
nrrdKernelCompare(const NrrdKernel *kernA, const double parmA[NRRD_KERNEL_PARMS_NUM],
const NrrdKernel *kernB, const double parmB[NRRD_KERNEL_PARMS_NUM],
- int *differ, char explain[AIR_STRLEN_LARGE]) {
+ int *differ, char explain[AIR_STRLEN_LARGE + 1]) {
static const char me[] = "nrrdKernelCompare";
unsigned int pnum, pidx;
@@ -3354,9 +3354,9 @@
*/
int /* Biff: 1 */
nrrdKernelSpecCompare(const NrrdKernelSpec *aa, const NrrdKernelSpec *bb, int *differ,
- char explain[AIR_STRLEN_LARGE]) {
+ char explain[AIR_STRLEN_LARGE + 1]) {
static const char me[] = "nrrdKernelSpecCompare";
- char subexplain[AIR_STRLEN_LARGE];
+ char subexplain[AIR_STRLEN_LARGE + 1];
if (!(differ)) {
biffAddf(NRRD, "%s: got NULL differ", me);
@@ -3433,8 +3433,9 @@
static const char me[] = "nrrdKernelCheck";
const NrrdKernel *parsedkern, *kernD;
double parsedparm[NRRD_KERNEL_PARMS_NUM], supp, integral;
- char kstr[AIR_STRLEN_LARGE], kspstr[AIR_STRLEN_LARGE], explain[AIR_STRLEN_LARGE],
- stmp[AIR_STRLEN_SMALL], kdstr[AIR_STRLEN_LARGE];
+ char kstr[AIR_STRLEN_LARGE + 1], kspstr[AIR_STRLEN_LARGE + 1],
+ explain[AIR_STRLEN_LARGE + 1], stmp[AIR_STRLEN_SMALL + 1],
+ kdstr[AIR_STRLEN_LARGE + 1];
int differ;
size_t evalIdx;
double *dom_d, *ran_d, wee;
Modified: teem/trunk/src/nrrd/map.c
===================================================================
--- teem/trunk/src/nrrd/map.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/map.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -134,7 +134,7 @@
static int /* Biff: 1 */
clampRoundConvert(Nrrd *nout, const Nrrd *nin, int type, int doClamp, int roundDir) {
static const char me[] = "clampRoundConvert";
- char typeS[AIR_STRLEN_SMALL];
+ char typeS[AIR_STRLEN_SMALL + 1];
size_t num, size[NRRD_DIM_MAX];
if (!(nin && nout && !nrrdCheck(nin) && !airEnumValCheck(nrrdType, type))) {
Modified: teem/trunk/src/nrrd/measure.c
===================================================================
--- teem/trunk/src/nrrd/measure.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/measure.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -1227,9 +1227,9 @@
/* allocate a scanline buffer */
if (!(line = AIR_CALLOC(linLen * iElSz, char))) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: couldn't calloc(%s,%s) scanline buffer", me,
- airSprintSize_t(stmp1, linLen), airSprintSize_t(stmp2, iElSz));
+ airSprintSize_t(stmp[0], linLen), airSprintSize_t(stmp[1], iElSz));
airMopError(mop);
return 1;
}
Modified: teem/trunk/src/nrrd/methodsNrrd.c
===================================================================
--- teem/trunk/src/nrrd/methodsNrrd.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/methodsNrrd.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -173,7 +173,7 @@
}
int /* Biff: 1 */
-nrrdBoundarySpecSprint(char str[AIR_STRLEN_LARGE], const NrrdBoundarySpec *bspec) {
+nrrdBoundarySpecSprint(char str[AIR_STRLEN_LARGE + 1], const NrrdBoundarySpec *bspec) {
static const char me[] = "nrrdBoundarySpecSprint";
char *out;
@@ -196,7 +196,7 @@
int /* Biff: 1 */
nrrdBoundarySpecCompare(const NrrdBoundarySpec *aa, const NrrdBoundarySpec *bb,
- int *differ, char explain[AIR_STRLEN_LARGE]) {
+ int *differ, char explain[AIR_STRLEN_LARGE + 1]) {
static const char me[] = "nrrdBoundarySpecCompare";
if (!differ) {
@@ -966,7 +966,7 @@
nrrdAlloc_nva(Nrrd *nrrd, int type, unsigned int dim, const size_t *size) {
static const char me[] = "nrrdAlloc_nva";
size_t num, esize;
- char stmp[2][AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
if (!(nrrd && size)) {
biffAddf(NRRD, "%s: got NULL pointer", me);
@@ -1065,7 +1065,7 @@
return 1;
}
if (!(0 < nrrd->blockSize)) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: given nrrd->blockSize %s invalid", me,
airSprintSize_t(stmp, nrrd->blockSize));
return 1;
@@ -1192,7 +1192,7 @@
*/
int /* Biff: 1 */
nrrdCompare(const Nrrd *ninA, const Nrrd *ninB, int onlyData, double epsilon,
- int *differ, char explain[AIR_STRLEN_LARGE]) {
+ int *differ, char explain[AIR_STRLEN_LARGE + 1]) {
static const char me[] = "nrrdCompare";
size_t numA, numB;
unsigned int axi, saxi;
@@ -1227,10 +1227,10 @@
numA = nrrdElementNumber(ninA);
numB = nrrdElementNumber(ninB);
if (numA != numB) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
*differ = numA < numB ? -1 : 1;
- sprintf(explain, "element # {A,B} %s %s %s", airSprintSize_t(stmp1, numA),
- *differ < 0 ? "<" : ">", airSprintSize_t(stmp2, numB));
+ sprintf(explain, "element # {A,B} %s %s %s", airSprintSize_t(stmp[0], numA),
+ *differ < 0 ? "<" : ">", airSprintSize_t(stmp[1], numB));
return 0;
}
/* this will always set *differ */
@@ -1255,10 +1255,10 @@
return 1;
}
if (*differ) {
- char tmpexplain[AIR_STRLEN_LARGE];
+ char tmpexplain[AIR_STRLEN_LARGE + 1];
/* the explanation, if wanted, is in "explain", but we add context */
sprintf(tmpexplain, "(axis %u) %s", axi, explain);
- airStrcpy(explain, AIR_STRLEN_LARGE, tmpexplain);
+ airStrcpy(explain, AIR_STRLEN_LARGE + 1, tmpexplain);
return 0;
}
}
@@ -1295,10 +1295,10 @@
if (ninA->blockSize != ninB->blockSize) {
*differ = ninA->blockSize < ninB->blockSize ? -1 : 1;
if (explain) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
sprintf(explain, "ninA->blockSize %s %s ninB->blockSize %s",
- airSprintSize_t(stmp1, ninA->blockSize), *differ < 0 ? "<" : ">",
- airSprintSize_t(stmp2, ninB->blockSize));
+ airSprintSize_t(stmp[0], ninA->blockSize), *differ < 0 ? "<" : ">",
+ airSprintSize_t(stmp[1], ninB->blockSize));
}
return 0;
}
@@ -1314,7 +1314,7 @@
}
for (saxi = 0; saxi < NRRD_SPACE_DIM_MAX; saxi++) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
unsigned int saxj;
sprintf(stmp, "spaceOrigin[%u]", saxi);
DOUBLE_COMPARE(spaceOrigin[saxi], stmp);
@@ -1338,7 +1338,7 @@
return 0;
} else {
unsigned int ii;
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
for (ii = 0; ii < ninA->cmtArr->len; ii++) {
sprintf(stmp, "comment[%u]", ii);
STRING_COMPARE(cmt[ii], stmp);
@@ -1353,7 +1353,7 @@
return 0;
} else {
unsigned int ii;
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
for (ii = 0; ii < ninA->kvpArr->len; ii++) {
sprintf(stmp, "key/value key[%u]", ii);
STRING_COMPARE(kvp[2 * ii + 0], stmp);
@@ -1379,7 +1379,7 @@
int /* Biff: 1 */
nrrdPPM(Nrrd *ppm, size_t sx, size_t sy) {
static const char me[] = "nrrdPPM";
- char stmp[2][AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
if (nrrdMaybeAlloc_va(ppm, nrrdTypeUChar, 3, AIR_CAST(size_t, 3), sx, sy)) {
biffAddf(NRRD, "%s: couldn't allocate %s x %s 24-bit image", me,
@@ -1399,7 +1399,7 @@
int /* Biff: 1 */
nrrdPGM(Nrrd *pgm, size_t sx, size_t sy) {
static const char me[] = "nrrdPGM";
- char stmp[2][AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
if (nrrdMaybeAlloc_va(pgm, nrrdTypeUChar, 2, sx, sy)) {
biffAddf(NRRD, "%s: couldn't allocate %s x %s 8-bit image", me,
Modified: teem/trunk/src/nrrd/nrrd.h
===================================================================
--- teem/trunk/src/nrrd/nrrd.h 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/nrrd.h 2023-07-07 21:14:40 UTC (rev 7038)
@@ -226,12 +226,12 @@
** All information and behavior relevent to one datafile format
*/
typedef struct {
- char name[AIR_STRLEN_SMALL]; /* short identifying string */
- int isImage, /* this format is intended solely for "2D" images, which
- controls the invocation of nrrdAxesInsert()
- if nrrdStateGrayscaleImage3D */
- readable, /* we can read as well as write this format */
- usesDIO; /* this format can use Direct IO */
+ char name[AIR_STRLEN_SMALL + 1]; /* short identifying string */
+ int isImage, /* this format is intended solely for "2D" images, which
+ controls the invocation of nrrdAxesInsert()
+ if nrrdStateGrayscaleImage3D */
+ readable, /* we can read as well as write this format */
+ usesDIO; /* this format can use Direct IO */
/* tests if this format is currently available in this build */
int (*available)(void);
@@ -262,8 +262,8 @@
** This is necessitated by the memory restrictions of direct I/O
*/
typedef struct NrrdEncoding_t {
- char name[AIR_STRLEN_SMALL], /* short identifying string */
- suffix[AIR_STRLEN_SMALL]; /* costumary filename suffix */
+ char name[AIR_STRLEN_SMALL + 1], /* short identifying string */
+ suffix[AIR_STRLEN_SMALL + 1]; /* customary filename suffix */
int endianMatters, isCompression;
int (*available)(void);
/* The "data" and "elementNum" values have to be passed explicitly
@@ -498,7 +498,7 @@
typedef struct {
/* terse string representation of kernel function, irrespective of
the parameter vector */
- char name[AIR_STRLEN_SMALL];
+ char name[AIR_STRLEN_SMALL + 1];
/* number of parameters needed (# elements in parm[] used) */
unsigned int numParm; /* HEY: should be "parmNum" in standard convention */
@@ -787,7 +787,7 @@
/******** arrays of things (poor-man's functions/predicates) */
/* arraysNrrd.c */
-NRRD_EXPORT const char nrrdTypePrintfStr[NRRD_TYPE_MAX + 1][AIR_STRLEN_SMALL];
+NRRD_EXPORT const char nrrdTypePrintfStr[NRRD_TYPE_MAX + 1][AIR_STRLEN_SMALL + 1];
NRRD_EXPORT const size_t nrrdTypeSize[NRRD_TYPE_MAX + 1];
NRRD_EXPORT const double nrrdTypeMin[NRRD_TYPE_MAX + 1];
NRRD_EXPORT const double nrrdTypeMax[NRRD_TYPE_MAX + 1];
@@ -803,12 +803,12 @@
NRRD_EXPORT NrrdBoundarySpec *nrrdBoundarySpecCopy(const NrrdBoundarySpec *bsp);
NRRD_EXPORT int nrrdBoundarySpecCheck(const NrrdBoundarySpec *bspec);
NRRD_EXPORT int nrrdBoundarySpecParse(NrrdBoundarySpec *bspec, const char *str);
-NRRD_EXPORT int nrrdBoundarySpecSprint(char str[AIR_STRLEN_LARGE],
+NRRD_EXPORT int nrrdBoundarySpecSprint(char str[AIR_STRLEN_LARGE + 1],
const NrrdBoundarySpec *bspec);
NRRD_EXPORT int nrrdBoundarySpecCompare(const NrrdBoundarySpec *bspecA,
const NrrdBoundarySpec *bspecB,
int *differ,
- char explain[AIR_STRLEN_LARGE]);
+ char explain[AIR_STRLEN_LARGE + 1]);
/* ---- END non-NrrdIO */
NRRD_EXPORT NrrdIoState *nrrdIoStateNew(void);
NRRD_EXPORT void nrrdIoStateInit(NrrdIoState *nio);
@@ -847,7 +847,8 @@
... /* size_t sx, sy, .., ax(dim-1) size */);
/* ---- BEGIN non-NrrdIO */
NRRD_EXPORT int nrrdCompare(const Nrrd *ninA, const Nrrd *ninB, int onlyData,
- double epsilon, int *differ, char explain[AIR_STRLEN_LARGE]);
+ double epsilon, int *differ,
+ char explain[AIR_STRLEN_LARGE + 1]);
NRRD_EXPORT int nrrdPPM(Nrrd *, size_t sx, size_t sy);
NRRD_EXPORT int nrrdPGM(Nrrd *, size_t sx, size_t sy);
/* ---- END non-NrrdIO */
@@ -874,7 +875,7 @@
NRRD_EXPORT int nrrdAxisInfoCompare(const NrrdAxisInfo *axisA,
const NrrdAxisInfo *axisB,
int *differ,
- char explain[AIR_STRLEN_LARGE]);
+ char explain[AIR_STRLEN_LARGE + 1]);
/* ---- END non-NrrdIO */
NRRD_EXPORT unsigned int nrrdDomainAxesGet(const Nrrd *nrrd,
unsigned int axisIdx[NRRD_DIM_MAX]);
@@ -1060,7 +1061,7 @@
const void *);
NRRD_EXPORT int nrrdArrayCompare(int type, const void *valA, const void *valB,
size_t valNum, double epsilon, int *differ,
- char explain[AIR_STRLEN_LARGE]);
+ char explain[AIR_STRLEN_LARGE + 1]);
/* ---- END non-NrrdIO */
/******** permuting, shuffling, and all flavors of reshaping */
@@ -1531,9 +1532,9 @@
double *parm,
const char *str);
NRRD_EXPORT int nrrdKernelSpecParse(NrrdKernelSpec *ksp, const char *str);
-NRRD_EXPORT int nrrdKernelSpecSprint(char str[AIR_STRLEN_LARGE],
+NRRD_EXPORT int nrrdKernelSpecSprint(char str[AIR_STRLEN_LARGE + 1],
const NrrdKernelSpec *ksp);
-NRRD_EXPORT int nrrdKernelSprint(char str[AIR_STRLEN_LARGE],
+NRRD_EXPORT int nrrdKernelSprint(char str[AIR_STRLEN_LARGE + 1],
const NrrdKernel *kernel,
const double kparm[NRRD_KERNEL_PARMS_NUM]);
NRRD_EXPORT int nrrdKernelCompare(const NrrdKernel *kernA,
@@ -1541,11 +1542,11 @@
const NrrdKernel *kernB,
const double parmB[NRRD_KERNEL_PARMS_NUM],
int *differ,
- char explain[AIR_STRLEN_LARGE]);
+ char explain[AIR_STRLEN_LARGE + 1]);
NRRD_EXPORT int nrrdKernelSpecCompare(const NrrdKernelSpec *aa,
const NrrdKernelSpec *bb,
int *differ,
- char explain[AIR_STRLEN_LARGE]);
+ char explain[AIR_STRLEN_LARGE + 1]);
NRRD_EXPORT int nrrdKernelCheck(const NrrdKernel *kern,
const double parm[NRRD_KERNEL_PARMS_NUM], size_t evalNum,
double epsilon, unsigned int diffOkEvalMax,
Modified: teem/trunk/src/nrrd/parseNrrd.c
===================================================================
--- teem/trunk/src/nrrd/parseNrrd.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/parseNrrd.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -1198,7 +1198,7 @@
_nrrdDataFNCheck(NrrdIoState *nio, Nrrd *nrrd, int useBiff) {
static const char me[] = "_nrrdDataFNCheck";
size_t pieceSize, pieceNum;
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
if (!nio->seen[nrrdField_sizes]) {
biffMaybeAddf(useBiff, NRRD,
Modified: teem/trunk/src/nrrd/read.c
===================================================================
--- teem/trunk/src/nrrd/read.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/read.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -214,10 +214,10 @@
nrrd->data = malloc(needDataSize);
}
if (!nrrd->data) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: couldn't allocate %s things of size %s", me,
- airSprintSize_t(stmp1, nrrdElementNumber(nrrd)),
- airSprintSize_t(stmp2, nrrdElementSize(nrrd)));
+ airSprintSize_t(stmp[0], nrrdElementNumber(nrrd)),
+ airSprintSize_t(stmp[1], nrrdElementSize(nrrd)));
return 1;
}
}
@@ -296,7 +296,7 @@
backwards = -byteSkip - 1;
/* HEY what if bsize fits in size_t but not in (signed) long? */
if (fseek(dataFile, -AIR_CAST(long, bsize) - backwards, SEEK_END)) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: failed to fseek(dataFile, %s, SEEK_END)", me,
airSprintSize_t(stmp, bsize));
return 1;
@@ -430,8 +430,8 @@
}
}
if (nrrdFormatUnknown == nio->format) {
- char linestart[AIR_STRLEN_SMALL], stmp[AIR_STRLEN_SMALL];
- airStrcpy(linestart, AIR_STRLEN_SMALL, nio->line);
+ char linestart[AIR_STRLEN_SMALL + 1], stmp[AIR_STRLEN_SMALL + 1];
+ airStrcpy(linestart, AIR_STRLEN_SMALL + 1, nio->line);
if (strlen(linestart) != strlen(nio->line)) {
biffAddf(NRRD,
"%s: couldn't parse (length %s) line starting "
Modified: teem/trunk/src/nrrd/reorder.c
===================================================================
--- teem/trunk/src/nrrd/reorder.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/reorder.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -151,7 +151,7 @@
int /* Biff: 1 */
nrrdAxesPermute(Nrrd *nout, const Nrrd *nin, const unsigned int *axes) {
static const char me[] = "nrrdAxesPermute", func[] = "permute";
- char buff1[NRRD_DIM_MAX * 30], buff2[AIR_STRLEN_SMALL];
+ char buff1[NRRD_DIM_MAX * 30], buff2[AIR_STRLEN_SMALL + 1];
size_t idxOut, idxInA = 0, /* indices for input and output scanlines */
lineSize, /* size of block of memory which can be
moved contiguously from input to output,
@@ -305,7 +305,7 @@
int /* Biff: 1 */
nrrdShuffle(Nrrd *nout, const Nrrd *nin, unsigned int axis, const size_t *perm) {
static const char me[] = "nrrdShuffle", func[] = "shuffle";
- char buff2[AIR_STRLEN_SMALL];
+ char buff2[AIR_STRLEN_SMALL + 1];
/* Sun Feb 8 13:13:58 CST 2009: There was a memory bug here caused
by using the same buff1[NRRD_DIM_MAX*30] declaration that had
worked fine for nrrdAxesPermute and nrrdReshape, but does NOT
@@ -341,7 +341,7 @@
len = AIR_UINT(nin->axis[axis].size);
for (ai = 0; ai < len; ai++) {
if (!(perm[ai] < len)) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: perm[%d] (%s) outside valid range [0,%d]", me, ai,
airSprintSize_t(stmp, perm[ai]), len - 1);
return 1;
@@ -408,7 +408,7 @@
if (len <= LONGEST_INTERESTING_AXIS) {
strcpy(buff1, "");
for (ai = 0; ai < len; ai++) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
sprintf(buff2, "%s%s", (ai ? "," : ""), airSprintSize_t(stmp, perm[ai]));
strcat(buff1, buff2);
}
@@ -576,7 +576,7 @@
Nrrd *ntmpperm, /* axis-permuted version of output */
**ninperm;
airArray *mop;
- char stmp[2][AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
/* error checking */
if (!(nout && nin)) {
@@ -831,7 +831,7 @@
return 1;
}
if (!(sizeFast * sizeSlow == nin->axis[saxi].size)) {
- char stmp[4][AIR_STRLEN_SMALL];
+ char stmp[4][AIR_STRLEN_SMALL + 1];
biffAddf(NRRD,
"%s: # samples along axis %d (%s) != "
"product of fast and slow sizes (%s * %s = %s)",
@@ -892,7 +892,7 @@
return 1;
}
if (1 != nin->axis[daxi].size) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD, "%s: size along axis %d is %s, not 1", me, daxi,
airSprintSize_t(stmp, nin->axis[daxi].size));
return 1;
@@ -978,10 +978,10 @@
int /* Biff: 1 */
nrrdReshape_nva(Nrrd *nout, const Nrrd *nin, unsigned int dim, const size_t *size) {
static const char me[] = "nrrdReshape_nva", func[] = "reshape";
- char buff1[NRRD_DIM_MAX * 30], buff2[AIR_STRLEN_SMALL];
+ char buff1[NRRD_DIM_MAX * 30], buff2[AIR_STRLEN_SMALL + 1];
size_t numOut;
unsigned int ai;
- char stmp[2][AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
if (!(nout && nin && size)) {
biffAddf(NRRD, "%s: got NULL pointer", me);
@@ -1157,7 +1157,7 @@
unsigned int dim;
size_t size[NRRD_DIM_MAX], outElSz;
int map[NRRD_DIM_MAX];
- char stmp[2][AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
if (!(nout && nin)) {
biffAddf(NRRD, "%s: got NULL pointer", me);
@@ -1370,7 +1370,7 @@
static const char me[] = "nrrdUntile2D";
int E;
unsigned int ii, mapIdx, map[NRRD_DIM_MAX];
- char stmp[2][AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
if (!(nout && nin)) {
biffAddf(NRRD, "%s: got NULL pointer", me);
Modified: teem/trunk/src/nrrd/resampleContext.c
===================================================================
--- teem/trunk/src/nrrd/resampleContext.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/resampleContext.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -290,7 +290,7 @@
rsmc->axis[axIdx].kparm[kpIdx] = kparm[kpIdx];
}
if (rsmc->verbose) {
- char kstr[AIR_STRLEN_LARGE];
+ char kstr[AIR_STRLEN_LARGE + 1];
NrrdKernelSpec ksp;
nrrdKernelSpecSet(&ksp, rsmc->axis[axIdx].kernel, rsmc->axis[axIdx].kparm);
nrrdKernelSpecSprint(kstr, &ksp);
@@ -1147,11 +1147,11 @@
}
}
if (rsmc->verbose) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
fprintf(stderr, "%s(%u): lineNum = %s\n", me, passIdx,
- airSprintSize_t(stmp1, lineNum));
+ airSprintSize_t(stmp[0], lineNum));
fprintf(stderr, "%s(%u): strideIn = %s, strideOut = %s\n", me, passIdx,
- airSprintSize_t(stmp1, strideIn), airSprintSize_t(stmp2, strideOut));
+ airSprintSize_t(stmp[0], strideIn), airSprintSize_t(stmp[1], strideOut));
}
/* allocate output for this pass */
Modified: teem/trunk/src/nrrd/resampleNrrd.c
===================================================================
--- teem/trunk/src/nrrd/resampleNrrd.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/resampleNrrd.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -129,7 +129,7 @@
const NrrdKernel *k;
int center, p, np;
unsigned int ai, minsmp;
- char stmp[2][AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
if (nrrdTypeBlock == nin->type || nrrdTypeBlock == info->type) {
biffAddf(NRRD, "%s: can't resample to or from type %s", me,
@@ -717,7 +717,7 @@
/* allocate output volume */
array[pi + 1] = (nrrdResample_t *)calloc(numOut, sizeof(nrrdResample_t));
if (!array[pi + 1]) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffAddf(NRRD,
"%s: couldn't create array of %s nrrdResample_t's for "
"output of pass %d",
Modified: teem/trunk/src/nrrd/simple.c
===================================================================
--- teem/trunk/src/nrrd/simple.c 2023-07-07 20:29:51 UTC (rev 7037)
+++ teem/trunk/src/nrrd/simple.c 2023-07-07 21:14:40 UTC (rev 7038)
@@ -413,7 +413,7 @@
nout->content = (char *)airFree(nout->content);
return 0;
}
- buff = (char *)malloc(128 * AIR_STRLEN_HUGE);
+ buff = (char *)malloc(128 * AIR_STRLEN_HUGE + 1);
if (!buff) {
biffAddf(NRRD, "%s: couln't alloc buffer!", me);
return 1;
@@ -515,7 +515,7 @@
void
nrrdDescribe(FILE *file, const Nrrd *nrrd) {
unsigned int ai;
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
if (file && nrrd) {
fprintf(file, "Nrrd at 0x%p:\n", AIR_CVOIDP(nrrd));
@@ -730,7 +730,7 @@
static int /* Biff: maybe:2:1 */
_nrrdFieldCheck_block_size(const Nrrd *nrrd, int useBiff) {
static const char me[] = "_nrrdFieldCheck_block_size";
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
if (nrrdTypeBlock == nrrd->type && (!(0 < nrrd->blockSize))) {
biffMaybeAddf(useBiff, NRRD, "%s: type is %s but nrrd->blockSize (%s) invalid", me,
@@ -920,7 +920,7 @@
}
wantLen = nrrdKindSize(val[ai]);
if (wantLen && wantLen != nrrd->axis[ai].size) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
biffMaybeAddf(useBiff, NRRD, "%s: axis %d kind %s requires size %u, but have %s",
me, ai, airEnumStr(nrrdKind, val[ai]), wantLen,
airSprintSize_t(stmp, nrrd->axis[ai].size));
@@ -1135,7 +1135,7 @@
nrrdSameSize(const Nrrd *n1, const Nrrd *n2, int useBiff) {
static const char me[] = "nrrdSameSize";
unsigned int ai;
- char stmp[2][AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
if (!(n1 && n2)) {
biffMaybeAddf(useBiff, NRRD, "%s: got NULL pointer", me);
@@ -1293,7 +1293,7 @@
static int /* Biff: 1 */
_nrrdCheckEnums(void) {
static const char me[] = "_nrrdCheckEnums";
- char which[AIR_STRLEN_SMALL];
+ char which[AIR...
[truncated message content] |