[GRASS5] [bug #3227] (grass) d.paint.labels uses wrong reference point

this bug's URL: http://intevation.de/rt/webrt?serial_num=3227
-------------------------------------------------------------------------

Subject: d.paint.labels uses wrong reference point

Platform: GNU/Linux/i386
grass obtained from: Mirror of Trento site
grass binary for platform: Compiled from Sources
GRASS Version: 5.3.0 (15 May 2004)

d.paint.labels does not use the second word in a two-word reference point name. "upper right" is parsed just as "upper", "lower left" is parsed as "lower" and so on. The problem is caused in the do_labels function when the input line containing the reference point data is scanned using the format string "%*s %s". Only the first of the two words in the reference point name is scanned.

If d.paint.labels uses other two-word data strings then those strings will probably also be scanned incorrectly. ps.map scans the same input line correctly.

I modified my copy by:

  1) replacing the sscanf call in do_labels with a function that returned a pointer to the data in the input line or NULL if the data weren't found

  2) passing that pointer to the scan_ref function

  3) I also modified scan_ref do detect a NULL pointer in its input.

Roger Miller
Lee Wilson and Associates

-------------------------------------------- Managed by Request Tracker