On Thu, 2018-11-29 at 21:31 +-0100, David Disseldorp wrote: +AD4 On Thu, 29 Nov 2018 08:24:38 -0800, Bart Van Assche wrote: +AD4 +AD4 On Thu, 2018-11-29 at 02:01 +-0100, David Disseldorp wrote: +AD4 +AD4 +AD4 +AFs ... +AF0 +AD4 +AD4 Additionally, have you considered to use strlcpy() +AD4 +AD4 instead of snprintf()? +AD4 +AD4 Happy to change the logic below over if you find it easier to follow. It would make the code shorter without hurting readability, so I think it would be better to use strlcpy(). But it's not that important to me. Bart.