From afdaa9e5bf465848ba24f983f01f0320cecaac8b Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Mon, 5 Oct 2009 23:52:35 +0200 Subject: fixed serial number conversion from hex --- src/openac/openac.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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); } -- cgit v1.2.3