diff options
Diffstat (limited to 'src/interfaces/ecpg/preproc/ecpg.header')
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.header | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.header b/src/interfaces/ecpg/preproc/ecpg.header index d3df8eabbb7..a415780faff 100644 --- a/src/interfaces/ecpg/preproc/ecpg.header +++ b/src/interfaces/ecpg/preproc/ecpg.header @@ -432,7 +432,8 @@ adjust_outofscope_cursor_vars(struct cursor *cur) /* This tests whether the cursor was declared and opened in the same function. */ #define SAMEFUNC(cur) \ ((cur->function == NULL) || \ - (cur->function != NULL && strcmp(cur->function, current_function) == 0)) + (cur->function != NULL && current_function != NULL && \ + strcmp(cur->function, current_function) == 0)) static struct cursor * add_additional_variables(const char *name, bool insert) |