View Issue Details

IDProjectCategoryView StatusLast Update
00004461003.1(2008)/Issue 7Shell and Utilitiespublic2013-04-16 13:06
Reporterdrepper Assigned Toajosey  
PrioritynormalSeverityEditorialTypeError
Status ClosedResolutionAccepted As Marked 
NameUlrich Drepper
Organization
User Referenceud-cksum
Sectioncksum
Page Number2530
Line Number81173
Interp Status---
Final Accepted TextSee 0000446:0000788
Summary0000446: incorrect variable type in example code
DescriptionI think at some point the parameters for the function provided in the cksum man page as an example implemented have been updated. But the local variables haven't. The variable i is supposed to iterate over a memory region. The upper limit is given in an size_t parameter but the variable is still unsigned int.
Desired ActionReplace line 81173 with

register size_t i;
register unsigned c, s = 0;
Tagstc1-2008

Activities

geoffclare

2011-05-20 09:23

manager   bugnote:0000788

As well as the n parameter changing to size_t, it looks like the b
parameter was changed to add unsigned, but later lines do not
reflect this.

So in addition to the change in the Desired Action, I think we
should also change:

    const char* b

to:

    const unsigned char* b

on line 81170 and change:

    c = (unsigned)(*b++);

to:

    c = *b++;

on line 81175.

Issue History

Date Modified Username Field Change
2011-05-19 15:35 drepper New Issue
2011-05-19 15:35 drepper Status New => Under Review
2011-05-19 15:35 drepper Assigned To => ajosey
2011-05-19 15:35 drepper Name => Ulrich Drepper
2011-05-19 15:35 drepper User Reference => ud-cksum
2011-05-19 15:35 drepper Section => cksum
2011-05-19 15:35 drepper Page Number => 2530
2011-05-19 15:35 drepper Line Number => 81173
2011-05-20 09:23 geoffclare Note Added: 0000788
2011-06-09 15:44 nick Interp Status => ---
2011-06-09 15:44 nick Final Accepted Text => See 0000446:0000788
2011-06-09 15:44 nick Status Under Review => Resolution Proposed
2011-06-09 15:44 nick Resolution Open => Accepted As Marked
2011-06-09 15:44 nick Tag Attached: tc1-2008
2011-06-09 16:00 geoffclare Status Resolution Proposed => Resolved
2013-04-16 13:06 ajosey Status Resolved => Closed