Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
curl_easy_strerror man page zero terminated #5598
I did this
This page says "zero terminated string"
I expected the following
"NUL terminated string"
There may be other parts of the manual that could be updated in a similar way.
[curl -V output]
Fair enough. I think there are lots of different opinions, although not seen 'zero' before. BSD generally call it 'NUL'. ASCII and https://en.wikipedia.org/wiki/ISO/IEC_646 call it NUL
The C and C++ standards don't use "zero".
I had a look at the linux man pages, they're consistently describing as "including the terminating null byte ('\0')"
Updated terminology in docs, comments and phrases to refer to C strings as "null-terminated". Done to unify with how most other C oriented docs refer of them and what users in general seem to prefer (based on a single highly unscientific poll on twitter). Reported-by: coinhubs on github Fixes #5598
Hi! null-terminated is the in common use. Personally I use NUL terminated, as it's clear it's not a NULL ptr, although C++ now has the nullptr keyword.
I looked online quite a few in favour of NUL
int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr)
POSIX uses NUL
C11 Annex K uses NUL
Right. The funny thing is I typically only hear the phrase "null-terminated", so no idea how people would write it. I don't recall ever hearing "zero-terminated" (in context of strings) even though it's perfectly understandable.
"7.1.1 Definitions of terms
Ok, yes I'm a native English speaker:
"A C string is a sequence of bytes which is null-terminated"
yes, the NUL byte http://www.asciitable.com/ is described as "null".
...Same as LF byte is described as "line feed". For me it seems we either state the macro name, or we provide the description. It's a bit like writing "EINVAL" or "Invalid argument" in relation to errno codes. Or "SIGSEGV" vs "Segmentation Violation" etc.