aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmdsserver/mds-message.c
diff options
context:
space:
mode:
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));