Opened 12 years ago

Closed 11 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 12 years ago.
Attempt to fix read issue

Download all attachments as: .zip

Change History (7)

comment:1 Changed 12 years ago by neteler

Version: 6.3.0 RCs6.3.0

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

Markus

Changed 12 years ago by neteler

Attachment: read_rules.diff added

Attempt to fix read issue

comment:2 Changed 11 years ago by neteler

Any objections that I apply this patch?

Markus

comment:3 Changed 11 years ago by neteler

CPU: Unspecified
Milestone: 6.3.16.4.0
Platform: Unspecified

comment:4 Changed 11 years ago by hamish

Platform: UnspecifiedMSWindows XP
Resolution: fixed
Status: newclosed

patch applied in r37019, r37019, r37020.

please test.

Hamish

comment:5 Changed 11 years ago by hamish

Resolution: fixed
Status: closedreopened

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

comment:6 Changed 11 years ago by hamish

Resolution: fixed
Status: reopenedclosed

done in r37021, 22, 23.

Note: See TracTickets for help on using tickets.