diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-07-18 00:19:24 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-07-18 00:32:54 +0000 |
commit | 392eef7900fdedda28f9c3aff5b0434f963a7f86 (patch) | |
tree | 216e8d28f2f8ad5555b22b0a617eb7ce6e9f3156 /toxcore/tox.h | |
parent | 13aa33a0f8655800ed1575223ac84322f69927b7 (diff) |
Correct the max hostname length constant.
256 bytes including NUL byte is confusing and makes for really annoying
bindings to other languages that don't account for NUL bytes in their
string length. We pass C strings, not byte arrays, for hostnames, so 255
makes more sense here.
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r-- | toxcore/tox.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h index 6a4df16d..40d37b0b 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h | |||
@@ -345,12 +345,12 @@ uint32_t tox_max_filename_length(void); | |||
345 | /** | 345 | /** |
346 | * Maximum length of a hostname, e.g. proxy or bootstrap node names. | 346 | * Maximum length of a hostname, e.g. proxy or bootstrap node names. |
347 | * | 347 | * |
348 | * This length includes the NUL byte. Hostnames are NUL-terminated C strings, so | 348 | * This length does not include the NUL byte. Hostnames are NUL-terminated C |
349 | * they are 255 characters plus one NUL byte. | 349 | * strings, so they are 255 characters plus one NUL byte. |
350 | * | 350 | * |
351 | * @deprecated The macro will be removed in 0.3.0. Use the function instead. | 351 | * @deprecated The macro will be removed in 0.3.0. Use the function instead. |
352 | */ | 352 | */ |
353 | #define TOX_MAX_HOSTNAME_LENGTH 256 | 353 | #define TOX_MAX_HOSTNAME_LENGTH 255 |
354 | 354 | ||
355 | uint32_t tox_max_hostname_length(void); | 355 | uint32_t tox_max_hostname_length(void); |
356 | 356 | ||