[Gridflow-cvs] [svn] commit: r3994 - /trunk/format/main.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Tue Jul 8 16:10:34 EDT 2008


Author: matju
Date: Tue Jul  8 16:10:34 2008
New Revision: 3994

Log:
fix uninitialized "nt"; use hex instead of octal

Modified:
    trunk/format/main.c

Modified: trunk/format/main.c
==============================================================================
--- trunk/format/main.c (original)
+++ trunk/format/main.c Tue Jul  8 16:10:34 2008
@@ -153,7 +153,8 @@
 	P<Dim> headerless_dim; // if null: headerful; if Dim: it is the assumed dimensions of received grids
 	\grin 0
 	\constructor (t_symbol *mode, string filename) {
-		strncpy(head.magic,is_le()?"\177grid":"\177GRID",5);
+		nt = int32_e;
+		strncpy(head.magic,is_le()?"\x7fgrid":"\x7fGRID",5);
 		head.type = 32;
 		_0_open(0,0,mode,filename);
 	}
@@ -176,8 +177,8 @@
 	} else {
 		fread(&head,1,8,f);
 		uint8 *m = (uint8 *)head.magic;
-		if (strncmp((char *)m,"\177grid",5)==0) endian=1; else
-		if (strncmp((char *)m,"\177GRID",5)==0) endian=1; else
+		if (strncmp((char *)m,"\x7fgrid",5)==0) endian=1; else
+		if (strncmp((char *)m,"\x7fGRID",5)==0) endian=1; else
 		RAISE("unknown header, can't read grid from file: "
 			"%02x %02x %02x %02x %02x %02x %02x %02x",
 			m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7]);



More information about the Gridflow-cvs mailing list