-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
curl_easy_strerror man page zero terminated #5598
Comments
A few more same that could be updated as well |
I usually go with "zero" in text instead of "nul" only because "nul" is too close to "null" and they're pronounced the same way and it certainly isn't NULL terminated... |
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 POSIX strcpy() glibc: 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')" https://man7.org/linux/man-pages/man3/strcpy.3.html Cheers |
My strcpy man page on Debian even uses the phrase "null-terminated". "man ascii" describes the character as |
I put up a very unscientific poll on twitter about it: |
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 https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html http://man7.org/linux/man-pages/man7/bpf-helpers.7.html int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr)
POSIX uses NUL http://man7.org/linux/man-pages/man3/strchr.3.html strchrnul() C11 Annex K uses NUL |
If we are going to change this phrase, we should go with the common, most preferred one, or not change it at all. Then it is really not a question of which our own personal preferences are... |
Also, the question is not what the character or byte is called. The question is how to say zero terminated the most common/standard way. |
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. |
C++ ISO/IEC C ISO/IEC "7.1.1 Definitions of terms |
I meant "cstring" is used in commonly by C++ programmers (most probably because it's short ;) ). |
Finish this sentence: "A C string is a sequence of bytes that is..."
I'm not a native English speaker but I know we can't use (2)... |
And nobody's gonna write / wants to read "terminated by a null character". |
I argue that "the string is terminated by a null character" and "the string is null-terminated" are just two sides of the same coin. In both cases we refer to the trailing character using the name "null". |
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. |
I don't follow you. What exactly are you proposing? You submit an issue saying we don't use the common terminology. We dig up the most commonly used and the most commonly preferred terminology but now that's not what you think we should use? |
As you say, the mostly commonly used is "null-terminated" So to give your example, that would be: |
I did this
https://curl.haxx.se/libcurl/c/curl_easy_strerror.html
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/libcurl version
[curl -V output]
operating system
The text was updated successfully, but these errors were encountered: