Skip to content

Commit

Permalink
Deduplicate strtoupper()
Browse files Browse the repository at this point in the history
Avoid the duplicate definition of strtoupper() in websocket.c, just use
the one from util.h.
  • Loading branch information
cgzones authored and allinurl committed May 14, 2024
1 parent a375bc4 commit 023b2d4
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "error.h"
#include "gslist.h"
#include "sha1.h"
#include "util.h"
#include "xmalloc.h"

/* *INDENT-OFF* */
Expand Down Expand Up @@ -350,24 +351,6 @@ escape_http_request (const char *src) {
return dest;
}

/* Make a string uppercase.
*
* On error the original string is returned.
* On success, the uppercased string is returned. */
static char *
strtoupper (char *str) {
char *p = str;
if (str == NULL || *str == '\0')
return str;

while (*p != '\0') {
*p = toupper ((int) *p);
p++;
}

return str;
}

/* Chop n characters from the beginning of the supplied buffer.
*
* The new length of the string is returned. */
Expand Down

0 comments on commit 023b2d4

Please sign in to comment.