mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
This util function was error-prone: - it accepted a buffer as parameter (not necessarily a NUL-terminated string) and its length (including the NUL char, if any); - it wrote '\0' over the last character of the buffer, so the last character was lost if the buffer was not a NUL-terminated string, and even worse, it caused undefined behavior if the length was empty; - it returned the length of the resulting NUL-terminated string, which was inconsistent with the input buffer length. In addition, it was not necessarily optimal: - it wrote '\0' twice; - it required to know the buffer length, that is the input string length + 1, in advance. Remove this function, and let the client use strcspn() manually. |
||
|---|---|---|
| .. | ||
| acksync.c | ||
| acksync.h | ||
| buffer_util.h | ||
| cbuf.h | ||
| file.c | ||
| file.h | ||
| intmap.c | ||
| intmap.h | ||
| intr.c | ||
| intr.h | ||
| log.c | ||
| log.h | ||
| net.c | ||
| net.h | ||
| net_intr.c | ||
| net_intr.h | ||
| process.c | ||
| process.h | ||
| process_intr.c | ||
| process_intr.h | ||
| queue.h | ||
| str.c | ||
| str.h | ||
| strbuf.c | ||
| strbuf.h | ||
| term.c | ||
| term.h | ||
| thread.c | ||
| thread.h | ||
| tick.c | ||
| tick.h | ||