Subject | UDF memory allocation? |
---|---|
Author | jarkkosoikkeli |
Post date | 2002-12-05T22:15:13Z |
Hello!
If you pass CSTRING(256) to substr-function. Is it sure that
Interbase/Firebird has allocated 256 bytes for that string so that
writing ending '\0' past the end of the string, but within 256 bytes,
is fine?
extern "C" char * __stdcall substr(char * str, int const * start, int
const * len) {
str[*start + *len] = '\0';
return &str[*start];
}
If you pass CSTRING(256) to substr-function. Is it sure that
Interbase/Firebird has allocated 256 bytes for that string so that
writing ending '\0' past the end of the string, but within 256 bytes,
is fine?
extern "C" char * __stdcall substr(char * str, int const * start, int
const * len) {
str[*start + *len] = '\0';
return &str[*start];
}