Skip to main content

Timeline for Primitive String trimmer in C

Current License: CC BY-SA 3.0

18 events
when toggle format what by license comment
Jun 10, 2020 at 13:24 history edited CommunityBot
Commonmark migration
Apr 25, 2017 at 3:15 review Suggested edits
Apr 25, 2017 at 5:10
Apr 25, 2017 at 2:29 review Suggested edits
Apr 25, 2017 at 3:02
Apr 23, 2017 at 19:10 vote accept geostocker
Apr 22, 2017 at 8:40 history edited pgs CC BY-SA 3.0
null vs NULL
Apr 22, 2017 at 5:13 comment added chux Re: "you didn't copy the NULL symbol". NULL is the null pointer constant, best used in context with pointers. The null character or '\0' is the symbol at the end of a string.
Apr 21, 2017 at 19:14 comment added Roland Illig In the NetBSD project, the convention for this kind of loops is to write while (condition) continue; — written in two separate lines, of course.
Apr 21, 2017 at 17:31 history edited pgs CC BY-SA 3.0
gramma
Apr 21, 2017 at 15:09 history edited pgs CC BY-SA 3.0
@holroy recommendations
Apr 21, 2017 at 15:05 comment added holroy @pgs, Both having the semicolon on a new line, or adding an empty brace set to indicate the empty loop would be better, in my opinion, rather than almost hiding the semicolon at the end of line. As it stands, it seems like wrong indentation on the else statement, and that the else statement is what happens during the while loop. Which really doesn't make any sense. You cold possibly also either have an empty comment in the while block, or move out the ++inputIndex into the while block to indicate the action of the while loop.
Apr 21, 2017 at 14:52 comment added pgs @holroy: so what is the good smell of C in this case?
Apr 21, 2017 at 14:49 comment added holroy I just saw one really bad smell of C-programming: The while (something);. That is really bad coding advice for new beginners, to have empty loops like that.
Apr 21, 2017 at 14:48 history edited Phrancis CC BY-SA 3.0
improve grammar
Apr 21, 2017 at 14:37 history edited pgs CC BY-SA 3.0
gnu style
Apr 21, 2017 at 14:28 comment added pacmaninbw Not your code, the original question. You pointed out a real bug in the program.
Apr 21, 2017 at 14:27 comment added pgs @pacmaninbw: why? There is output[k] = '\0'; for this purpose.
Apr 21, 2017 at 14:21 comment added pacmaninbw is correct, you actually have a bug in your code because of the lack of NULL termination on output.
Apr 21, 2017 at 14:02 history answered pgs CC BY-SA 3.0