mirror of https://github.com/citusdata/citus.git
Indent
parent
21298f6661
commit
e9a6f8a7c5
|
@ -681,6 +681,7 @@ extractTopComment(const char *inputString)
|
|||
}
|
||||
|
||||
int i = 0;
|
||||
|
||||
/* If query starts with a comment */
|
||||
if (inputString[i] == '/' && inputString[i + 1] == '*')
|
||||
{
|
||||
|
@ -702,23 +703,25 @@ extractTopComment(const char *inputString)
|
|||
}
|
||||
}
|
||||
|
||||
static char*
|
||||
get_substring(const char* str, int start, int end) {
|
||||
int len = strlen(str);
|
||||
char* substr = NULL;
|
||||
|
||||
// Ensure start and end are within the bounds of the string
|
||||
if (start < 0 || end > len || start > end) {
|
||||
static char *
|
||||
get_substring(const char *str, int start, int end)
|
||||
{
|
||||
int len = strlen(str);
|
||||
|
||||
/* Ensure start and end are within the bounds of the string */
|
||||
if (start < 0 || end > len || start > end)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Allocate memory for the substring
|
||||
substr = (char*) palloc((end - start + 1) * sizeof(char));
|
||||
/* Allocate memory for the substring */
|
||||
char *substr = (char *) palloc((end - start + 1) * sizeof(char));
|
||||
|
||||
// Copy the substring to the new memory location
|
||||
/* Copy the substring to the new memory location */
|
||||
strncpy_s(substr, end - start + 1, str + start, end - start);
|
||||
|
||||
// Add null terminator to end the substring
|
||||
/* Add null terminator to end the substring */
|
||||
substr[end - start] = '\0';
|
||||
|
||||
return substr;
|
||||
|
|
Loading…
Reference in New Issue