Opened 17 years ago

Closed 16 years ago

#172 closed defect (fixed)

r.recode truncates last character in rules file.

Reported by: bgullatt Owned by: grass-dev@…
Priority: major Milestone: 6.4.0
Component: Default Version: 6.3.0
Keywords: r.recode rules Cc:
CPU: Unspecified Platform: MSWindows XP

Description

When running r.recode (wingrass63rc5 & qgis0.10.0) the last character in the rules file gets truncated such that it scales the recode by a factor of 10. Work around is to add a zero. Found this when using r.recode to convert from fcell(float) to cell(int) for compatability with existing application built on grass4x.

Tested at command line rather than rules file and got correct values. Problem is in rules file processing.

Attachments (1)

read_rules.diff (438 bytes ) - added by neteler 17 years ago.
Attempt to fix read issue

Download all attachments as: .zip

Change History (7)

comment:1 by neteler, 17 years ago

Version: 6.3.0 RCs6.3.0

Can you replace fgets() with G_getl2() and try again? Untested patch attached.

Markus

by neteler, 17 years ago

Attachment: read_rules.diff added

Attempt to fix read issue

comment:2 by neteler, 17 years ago

Any objections that I apply this patch?

Markus

comment:3 by neteler, 16 years ago

CPU: Unspecified
Milestone: 6.3.16.4.0
Platform: Unspecified

comment:4 by hamish, 16 years ago

Platform: UnspecifiedMSWindows XP
Resolution: fixed
Status: newclosed

patch applied in r37019, r37019, r37020.

please test.

Hamish

comment:5 by hamish, 16 years ago

Resolution: fixed
Status: closedreopened

oops, read_rules.c line 73: buf[strlen(buf) - 1] = '\0';

comment:6 by hamish, 16 years ago

Resolution: fixed
Status: reopenedclosed

done in r37021, 22, 23.

Note: See TracTickets for help on using tickets.