mirror of https://github.com/citusdata/citus.git
Convert char* to text for text_substr call
parent
df3ad5c4f6
commit
34e1dafb18
|
@ -646,9 +646,9 @@ ExtractTopComment(const char *inputString)
|
|||
if (commentEndCharsIndex > commentStartCharsLength)
|
||||
{
|
||||
Datum substringTextDatum = DirectFunctionCall3(text_substr, PointerGetDatum(
|
||||
inputString),
|
||||
cstring_to_text(inputString)),
|
||||
Int32GetDatum(
|
||||
commentStartCharsLength),
|
||||
commentStartCharsLength + 1),
|
||||
Int32GetDatum(
|
||||
commentEndCharsIndex -
|
||||
commentStartCharsLength));
|
||||
|
@ -666,7 +666,7 @@ static char *
|
|||
EscapeCommentChars(const char *str)
|
||||
{
|
||||
int originalStringLength = strlen(str);
|
||||
char *escapedString = (char *) palloc(originalStringLength * 2 + 1);
|
||||
char *escapedString = (char *) palloc0((originalStringLength * 2 + 1) * sizeof(char));
|
||||
int escapedStringIndex = 0;
|
||||
|
||||
for (int originalStringIndex = 0; originalStringIndex < originalStringLength;
|
||||
|
@ -689,7 +689,7 @@ static char *
|
|||
UnescapeCommentChars(const char *str)
|
||||
{
|
||||
int originalStringLength = strlen(str);
|
||||
char *unescapedString = (char *) palloc(originalStringLength + 1);
|
||||
char *unescapedString = (char *) palloc0((originalStringLength + 1) * sizeof(char));
|
||||
int unescapedStringIndex = 0;
|
||||
|
||||
for (int originalStringindex = 0; originalStringindex < originalStringLength;
|
||||
|
|
Loading…
Reference in New Issue