455b891fac7999a0f7d6ac320b8780cd4d60393c max Thu Jan 16 06:09:30 2014 -0800 fixing a null pointer bug introduced in earlier commit today diff --git src/lib/udc.c src/lib/udc.c index 0c1e122..b9914dd 100644 --- src/lib/udc.c +++ src/lib/udc.c @@ -1381,31 +1381,31 @@ val = byteSwapFloat(val); return val; } double udcReadDouble(struct udcFile *file, boolean isSwapped) /* Read and optionally byte-swap double-precision floating point number. */ { double val; udcMustRead(file, &val, sizeof(val)); if (isSwapped) val = byteSwapDouble(val); return val; } char *udcReadLine(struct udcFile *file) -/* Fetch next line from udc cache. */ +/* Fetch next line from udc cache or NULL. */ { char shortBuf[2], *longBuf = NULL, *buf = shortBuf; int i, bufSize = sizeof(shortBuf); for (i=0; ; ++i) { /* See if need to expand buffer, which is initially on stack, but if it gets big goes into * heap. */ if (i >= bufSize) { int newBufSize = bufSize*2; char *newBuf = needLargeMem(newBufSize); memcpy(newBuf, buf, bufSize); freeMem(longBuf); buf = longBuf = newBuf; bufSize = newBufSize;