mirror of
https://github.com/curl/curl.git
synced 2026-08-25 00:03:33 +03:00
tidy-up: use CURL_CSTRLEN() macro on more static strings
Follow-up to e1450d8fda #22406
Closes #22424
This commit is contained in:
parent
8186edf85d
commit
59dc2bbe07
6 changed files with 11 additions and 11 deletions
|
|
@ -690,10 +690,10 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req)
|
|||
case RCMD_STREAM: {
|
||||
static const char streamthis[] = "a string to stream 01234567890\n";
|
||||
for(;;) {
|
||||
written = swrite(sock, streamthis, sizeof(streamthis) - 1);
|
||||
written = swrite(sock, streamthis, CURL_CSTRLEN(streamthis));
|
||||
if(got_exit_signal)
|
||||
return -1;
|
||||
if(written != (ssize_t)(sizeof(streamthis) - 1)) {
|
||||
if(written != (ssize_t)CURL_CSTRLEN(streamthis)) {
|
||||
logmsg("Stopped streaming");
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ static void exit_signal_handler(int signum)
|
|||
int old_errno = errno;
|
||||
if(!serverlogfile) {
|
||||
static const char msg[] = "exit_signal_handler: serverlogfile not set\n";
|
||||
(void)write(STDERR_FILENO, msg, sizeof(msg) - 1);
|
||||
(void)write(STDERR_FILENO, msg, CURL_CSTRLEN(msg));
|
||||
}
|
||||
else {
|
||||
int fd = -1;
|
||||
|
|
@ -394,12 +394,12 @@ static void exit_signal_handler(int signum)
|
|||
if(fd != -1) {
|
||||
#endif
|
||||
static const char msg[] = "exit_signal_handler: called\n";
|
||||
(void)write(fd, msg, sizeof(msg) - 1);
|
||||
(void)write(fd, msg, CURL_CSTRLEN(msg));
|
||||
curlx_close(fd);
|
||||
}
|
||||
else {
|
||||
static const char msg[] = "exit_signal_handler: failed opening ";
|
||||
(void)write(STDERR_FILENO, msg, sizeof(msg) - 1);
|
||||
(void)write(STDERR_FILENO, msg, CURL_CSTRLEN(msg));
|
||||
(void)write(STDERR_FILENO, serverlogfile, strlen(serverlogfile));
|
||||
(void)write(STDERR_FILENO, "\n", 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue