'Libary' problems, and syscalls.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

piranha wrote:Well, I said that is a post where the code didn't use a "..." string.
Yes, and that is why you have to add a '\0' to the end of it. I was expressing my surprise at this surprising you.
Plus appending a \0 character to the array I used worked.
Of course. What I meant is that you don't have to do that array thing with '\0' appending, because "..." does that automatically for you - with the difference that character constants end up in .data, string constants in .rodata.
Every good solution is obvious once you've found it.
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Post by piranha »

A \0 character is appended automatically when you use "...". A C coder of some repute should know that.
and
piranha wrote:
Well, I said that is a post where the code didn't use a "..." string.


Yes, and that is why you have to add a '\0' to the end of it. I was expressing my surprise at this surprising you.
Seem like 2 different thing.
It didn't surprise me. I just said thats what I had to do. I didn't say "Woah" or anything.

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Post Reply