Commit Graph

5 Commits

Author SHA1 Message Date
Xavier Del Campo Romero b3ef22ac2a
Define _POSIX_C_SOURCE
This allows using the default compiler defined by make(1) (i.e.,
c99(1)), thus improving POSIX compatibility.
2023-03-24 02:49:11 +01:00
Xavier Del Campo Romero 5e100ff3c1
server.c: Fix wrong size for memcpy(3) 2023-03-08 01:17:34 +01:00
Xavier Del Campo Romero 0954abcf09
server.c: Minor const-correctness improvement 2023-03-07 12:41:03 +01:00
Xavier Del Campo Romero 62bdf9f72f
Fix memory leak on failed realloc(3)
According to C99 §7.20.3.4:

If memory for the new object cannot be allocated, the old object is not
deallocated and its value is unchanged.

Therefore, a temporary pointer must be used to ensure the original
object can still be deallocated should realloc(3) return a null pointer.
2023-03-04 03:03:15 +01:00
Xavier Del Campo Romero d26f046fc9
Initial commit 2023-02-28 01:43:56 +01:00