View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update | 
|---|---|---|---|---|---|
| 0000665 | LDMud 3.6 | Efuns | public | 2009-06-18 15:12 | 2022-01-09 20:34 | 
| Reporter | garapol | Assigned To | Gnomi | ||
| Priority | normal | Severity | minor | Reproducibility | always | 
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.3.718 | ||||
| Fixed in Version | 3.6.5 | ||||
| Summary | 0000665: sscanf and %% don't like each other | ||||
| Description | sscanf(str, fmt, junk, junk2) does not work correctly for some of the following: str | fmt | result | should result ----------+------------+--------------+--------------------- te%st | %s%%%s | (te, 0) | (te, st) %%s | %s%%%s | (%, 0) | (%, s) oder (0, %s) s%%%%%t%% | %s%%t | s%%%% | 0 s%%%%% | %s%% | s | s%%%% s% | %s%% | s | s (Ok) %%s | %%%s | %s | %s (Ok) %s | %%%s | s | s (Ok) BTW: In efun.c the sscanf-code have some gotos. ;-) Garapol Leckerlin (@Avalon) | ||||
| Additional Information | I don't know wether other format strings may have bugs, too. I only saw these for %%. | ||||
| Tags | No tags attached. | ||||
|  | I don't agree with the 3rd and 4th case: sscanf("s%%%%%t%%", ""%s%%t", x) should yield "s%%%" instead of 0. sscanf("s%%%%%", "%s%%", x) can yield "s". sscanf() is never required the match the whole input string. Therefore "s%%%" is valid result in the first case, because for %s it is only required that the following characters match as well (%t), which they do. In the second case "s" is also a valid result, because the following characters (in this case "%") match. | 
| Date Modified | Username | Field | Change | 
|---|---|---|---|
| 2009-06-18 15:12 | garapol | New Issue | |
| 2021-04-08 17:37 | Gnomi | Note Added: 0002572 | |
| 2021-04-08 17:37 | Gnomi | Assigned To | => Gnomi | 
| 2021-04-08 17:37 | Gnomi | Status | new => assigned | 
| 2022-01-09 20:34 | Gnomi | Project | LDMud => LDMud 3.6 | 
| 2022-01-09 20:34 | Gnomi | Status | assigned => resolved | 
| 2022-01-09 20:34 | Gnomi | Resolution | open => fixed | 
| 2022-01-09 20:34 | Gnomi | Fixed in Version | => 3.6.5 | 
