diff options
| Commit | d64b669582fcd274b64d95e7f546ecbe35dc1082 (patch) | |
|---|---|---|
| Author | 2023-12-08 17:20:59 +0200 | |
| Committer | 2023-12-08 17:20:59 +0200 | |
| Files | 451ed43da00d6b3a4bc05936440bdde894f54aff /util.c | |
| pico-web-d64b669582fcd274b64d95e7f546ecbe35dc1082.tar pico-web-d64b669582fcd274b64d95e7f546ecbe35dc1082.tar.gz pico-web-d64b669582fcd274b64d95e7f546ecbe35dc1082.zip | ||
| Parent | 699cef84b11d43ac23b6bc7b1b605aa8c53f35b6 (diff) | |
[browser] Cleaned up and reorganized code
1 files changed, 7 insertions, 1 deletions
| -rw-r--r-- | util.c | 8 |
@@ -7,10 +7,16 @@ #include <errno.h> #include <regex.h> -uint16_t inet_atop(const char *port) { +uint16_t atop(const char *port) { return htons(atoi(port)); } +struct in_addr aton(const char* cp, int* output) { + struct in_addr inp; + *output = inet_aton(cp, &inp); + return inp; +} + void herrc(int output, const char* funcName) { if (output < 0 && errno != EINTR) { perror(funcName); |
