Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for Mythical Programmer
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #278837 |
Does the code handle `%%`, which means a single `%` in the input? The POSIX specification for [`scanf()`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/scanf.html)
also provides some options your code does not consider — conversion specifiers `S` and `C`, the modifier `m`, and the `%n$... (more) |
— | almost 3 years ago |
Edit | Post #278848 |
Post edited: The two mismatched double-character length modifiers should have different sequences hl and lh |
— | about 4 years ago |
Comment | Post #278848 |
@klutt — I took your code from PasteBin and added a test for `%s%n` (expecting 1), and got the output `%s%n 1 1 2` followed by an assertion failure for `(count == warnings)`. The trouble is that `%n` requires a matching `int *` argument, but it doesn't get counted as a conversion. (more) |
— | about 4 years ago |
Edit | Post #278848 |
Post edited: |
— | about 4 years ago |
Edit | Post #278848 |
Post edited: Note about %hld etc. |
— | about 4 years ago |
Edit | Post #278848 |
Post edited: Remove an unnecessary `%` in the second complex scan set. |
— | about 4 years ago |
Edit | Post #278848 | Initial revision | — | about 4 years ago |
Answer | — |
A: Counting number of assignments that a `fscanf` format strings implies Just looking at your code, I think you'll need to look at a few nasties in scan sets: `%[^]%a-z]` stops at the second `]`, not the first, for example, and I think your code would misconstrue the `%a` as a conversion rather than part of the scan set. Likewise `%[]%[a-z]`; the one scan set there ... (more) |
— | about 4 years ago |