View Issue Details

IDProjectCategoryView StatusLast Update
0000473LDMud 3.3Efunspublic2009-01-17 10:52
ReporterFiona Assigned Tozesstra  
PrioritynormalSeveritytrivialReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.3.713 
Target Version3.3.719Fixed in Version3.3.719 
Summary0000473: trim() does not trim \0
Descriptiontrim(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.
TagsNo tags attached.

Activities

zesstra

2009-01-08 05:38

administrator   ~0000858

Ok, as far as I see, should be harmless to just disallow number < 0 instead of <= 0. Will do so in 3.3.719.

zesstra

2009-01-16 14:05

administrator   ~0000906

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;

zesstra

2009-01-17 10:52

administrator   ~0000916

Changed check for argument values in v_trim() in r2503.

Issue History

Date Modified Username Field Change
2006-06-06 02:27 Fiona New Issue
2009-01-08 05:32 zesstra Status new => assigned
2009-01-08 05:32 zesstra Assigned To => zesstra
2009-01-08 05:38 zesstra Note Added: 0000858
2009-01-08 05:38 zesstra Target Version => 3.3.719
2009-01-16 14:05 zesstra Note Added: 0000906
2009-01-17 10:52 zesstra Note Added: 0000916
2009-01-17 10:52 zesstra Status assigned => resolved
2009-01-17 10:52 zesstra Fixed in Version => 3.3.719
2009-01-17 10:52 zesstra Resolution open => fixed