Finally added StringToDouble function (should work for the majority of the cases). Additionally fixed bug in StringFromDouble related to incorrect rounding and added asserts (should add more asserts in the following commits). Also implemented some optimizations from Burger and Dybvig paper.
22 lines
294 B
C
22 lines
294 B
C
#include <BH/String.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
|
|
void BH_StringFree(char *string)
|
|
{
|
|
free(string);
|
|
}
|
|
|
|
|
|
char *BH_StringCopy(const char *string)
|
|
{
|
|
char *result;
|
|
|
|
result = malloc(strlen(string) + 1);
|
|
if (result)
|
|
strcpy(result, string);
|
|
|
|
return result;
|
|
}
|