raw2ascii looped while reading the dem30 header file
alexis bory <[email protected]> Fri, 26 Jan 2007 23:19:40 +0100
| Newsgroups | gmane.games.flightgear.terragear.devel |
|---|---|
| Message-ID | <[email protected]> |
Dear TerraGear guru,
On my plateforme (Linux 2.6.15-27-amd64-generic with Ubuntu Dapper)
raw2ascii enter a loop while reading the dem30 header file.
Whithout understanding any C++ character handling, I just modified an
easy while condition in
TerraGear-0.0/source/src/Prep/DemRaw2ascii/rawdem.c and it worked fine.
Here, rawReadDemHdr returned i = 1 after the last consistant line.
Following is a patch for it.
Cheers,
Alexis
Index: rawdem.c
===================================================================
RCS file: /var/cvs/TerraGear-0.0/source/src/Prep/DemRaw2ascii/rawdem.c,v
retrieving revision 1.11
diff -u -p -r1.11 rawdem.c
--- rawdem.c 19 Nov 2004 22:25:51 -0000 1.11
+++ rawdem.c 26 Jan 2007 20:28:32 -0000
@@ -98,7 +98,7 @@ void rawReadDemHdr( fgRAWDEM *raw, char
raw->big_endian = 1;
/* process each line */
- while ( (reads(fileno(hdr), line, 256) != 0) ) {
+ while ( (reads(fileno(hdr), line, 256) > 1) ) {
printf("%s", line);
len = strlen(line);
_______________________________________________
Terragear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/terragear-devel
2f585eeea02e2c79d7b1d8c4963bae2d