aboutsummaryrefslogtreecommitdiffstats
path: root/src/openac/openac.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/openac/openac.c')
-rwxr-xr-xsrc/openac/openac.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/openac/openac.c b/src/openac/openac.c
index 89acc06b9..2b9270ff9 100755
--- a/src/openac/openac.c
+++ b/src/openac/openac.c
@@ -93,6 +93,11 @@ static chunk_t read_serial(void)
hex.len = fread(hex.ptr, 1, hex.len, fd);
if (hex.len)
{
+ /* remove any terminating newline character */
+ if (hex.ptr[hex.len-1] == '\n')
+ {
+ hex.len--;
+ }
serial = chunk_alloca((hex.len / 2) + (hex.len % 2));
serial = chunk_from_hex(hex, serial.ptr);
}