From a56ce2af7b82f85f22a091b2a7e75edd632cb9ce Mon Sep 17 00:00:00 2001 From: Alexander Moibenko Date: Mon, 22 Jan 2024 18:17:22 +0300 Subject: [PATCH] Fix: Serial Number for one os systems had non alpha numeric tail. --- mtx-1.3.12/mtxl.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/mtx-1.3.12/mtxl.c b/mtx-1.3.12/mtxl.c index 3f0fe75..8a9e34b 100644 --- a/mtx-1.3.12/mtxl.c +++ b/mtx-1.3.12/mtxl.c @@ -26,6 +26,7 @@ * overflow :-(. That could be important if mtxl is SUID for some reason. */ +#include #include "mtx.h" #include "mtxl.h" @@ -630,13 +631,10 @@ void copy_char_buffer(unsigned char *src, unsigned char *dest, int num) for (i=0; i < num; i++) { - *dest = *src++; - - if ((*dest < 32) || (*dest > 127)) - { - *dest = 0; - break; - } + if (isalnum(*src)) { + *dest = *src; + } + src++; dest++; } *dest = 0;