Skip to content

Commit c86f493

Browse files
authored
ehs: Fix datum buffer size
1 parent 36f9054 commit c86f493

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

vendor/ehs/datum.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#include <stdio.h>
44
#include <stdlib.h>
55
#include <string.h>
6+
7+
#define DATUM_BUFFER_SIZE 350
8+
69
#ifdef _WIN32
710
#define strcasecmp stricmp
811
#endif
@@ -25,8 +28,8 @@ Datum & Datum::operator= ( int inInt )
2528
}
2629
Datum & Datum::operator= ( double inDouble )
2730
{
28-
char psBuffer [ 100 ];
29-
sprintf ( psBuffer, "%lf", inDouble );
31+
char psBuffer [ DATUM_BUFFER_SIZE ];
32+
snprintf ( psBuffer, DATUM_BUFFER_SIZE, "%lf", inDouble );
3033
sDatum = psBuffer;
3134
return *this;
3235
}

0 commit comments

Comments
 (0)