View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000473 | LDMud 3.3 | Efuns | public | 2006-06-06 00:27 | 2009-01-17 09:52 |
Reporter | Fiona | Assigned To | zesstra | ||
Priority | normal | Severity | trivial | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.3.713 | ||||
Target Version | 3.3.719 | Fixed in Version | 3.3.719 | ||
Summary | 0000473: trim() does not trim \0 | ||||
Description | trim(str, TRIM_BOTH, "\0") works just fine, but trim(str, TRIM_BOTH, 0) states that "0 is not a character" more or less true, but I think it should work anyhow. | ||||
Tags | No tags attached. | ||||
|
Ok, as far as I see, should be harmless to just disallow number < 0 instead of <= 0. Will do so in 3.3.719. |
|
As trim can already handle "\0", the patch would be to just relax the argument checks: Index: efuns.c =================================================================== --- efuns.c (Revision 2491) +++ efuns.c (Arbeitskopie) @@ -1616,7 +1616,7 @@ { if (argp[2].type == T_NUMBER) { - if (argp[2].u.number <= 0 || argp[2].u.number >= 1 << CHAR_BIT) + if (argp[2].u.number < 0 || argp[2].u.number >= 1 << CHAR_BIT) errorf("Bad argument 3 to trim(): %"PRIdPINT " is not a character\n", argp[2].u.number); def_ch[0] = (char)argp[2].u.number; |
|
Changed check for argument values in v_trim() in r2503. |
Date Modified | Username | Field | Change |
---|---|---|---|
2006-06-06 00:27 | Fiona | New Issue | |
2009-01-08 04:32 | zesstra | Status | new => assigned |
2009-01-08 04:32 | zesstra | Assigned To | => zesstra |
2009-01-08 04:38 | zesstra | Note Added: 0000858 | |
2009-01-08 04:38 | zesstra | Target Version | => 3.3.719 |
2009-01-16 13:05 | zesstra | Note Added: 0000906 | |
2009-01-17 09:52 | zesstra | Note Added: 0000916 | |
2009-01-17 09:52 | zesstra | Status | assigned => resolved |
2009-01-17 09:52 | zesstra | Fixed in Version | => 3.3.719 |
2009-01-17 09:52 | zesstra | Resolution | open => fixed |