Fix: Serial Number for one os systems had non alpha numeric tail.

This commit is contained in:
Alexander Moibenko
2024-01-22 18:17:22 +03:00
parent 14e20937d3
commit a56ce2af7b

View File

@@ -26,6 +26,7 @@
* overflow :-(. That could be important if mtxl is SUID for some reason.
*/
#include <ctype.h>
#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;