mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-10 00:20:54 +08:00
Improve bounds checking
No particular crashes, but replace strcpy / strncpy with snprintf and GLib functions wherever possible.
This commit is contained in:
@@ -100,7 +100,7 @@ int mdb_test_int(MdbSargNode *node, gint32 i)
|
||||
static double poor_mans_trunc(double x)
|
||||
{
|
||||
char buf[16];
|
||||
sprintf(buf, "%.6f", x);
|
||||
snprintf(buf, sizeof(buf), "%.6f", x);
|
||||
sscanf(buf, "%lf", &x);
|
||||
return x;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user