aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmdsserver/mds-message.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2024-10-05 23:23:17 +0200
committerMattias Andrée <m@maandree.se>2024-10-05 23:23:17 +0200
commit98a8ac8498974e499fc129878ab05b9a7bf8ba30 (patch)
tree2914967687516632a93da9af59818f22d3120861 /src/libmdsserver/mds-message.c
parentUpdate e-mail (diff)
downloadmds-master.tar.gz
mds-master.tar.bz2
mds-master.tar.xz
misc + update e-mailHEADmaster
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'src/libmdsserver/mds-message.c')
-rw-r--r--src/libmdsserver/mds-message.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libmdsserver/mds-message.c b/src/libmdsserver/mds-message.c
index c3d968f..0e93520 100644
--- a/src/libmdsserver/mds-message.c
+++ b/src/libmdsserver/mds-message.c
@@ -1,6 +1,6 @@
/**
* mds — A micro-display server
- * Copyright © 2014, 2015, 2016, 2017 Mattias Andrée (maandree@kth.se)
+ * Copyright © 2014, 2015, 2016, 2017 Mattias Andrée (m@maandree.se)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -196,7 +196,7 @@ validate_header(const char *header, size_t length)
{
char *p = memchr(header, ':', length * sizeof(char));
- if (verify_utf8(header, 0) < 0)
+ if (!isutf8(header, 0))
/* Either the string is not UTF-8, or your are under an UTF-8 attack,
let's just call this unrecoverable because the client will not correct. */
return -2;
@@ -392,7 +392,7 @@ mds_message_read(mds_message_t *restrict this, int fd)
/* How much of the payload that has not yet been filled. */
need = this->payload_size - this->payload_ptr;
/* How much we have of that what is needed. */
- move = min(this->buffer_ptr, need);
+ move = MIN(this->buffer_ptr, need);
/* Copy what we have, and remove it from the the read buffer. */
memcpy(this->payload + this->payload_ptr, this->buffer, move * sizeof(char));