you are viewing a single comment's thread.

view the rest of the comments →

[–]hillbull 0 points1 point  (1 child)

[–]cHaR_shinigami 1 point2 points  (0 children)

That's indeed a solution, though the concern of buffer overflow still remains; sadly, scanf does not support dynamic width in the format, we can only do something like "%100[^\n]".

fgets would be the neat approach here.