Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

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