aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial/complex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tutorial/complex.c')
-rw-r--r--src/tutorial/complex.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tutorial/complex.c b/src/tutorial/complex.c
index edae0065c7d..80655885d50 100644
--- a/src/tutorial/complex.c
+++ b/src/tutorial/complex.c
@@ -73,8 +73,7 @@ complex_out(PG_FUNCTION_ARGS)
Complex *complex = (Complex *) PG_GETARG_POINTER(0);
char *result;
- result = (char *) palloc(100);
- snprintf(result, 100, "(%g,%g)", complex->x, complex->y);
+ result = psprintf("(%g,%g)", complex->x, complex->y);
PG_RETURN_CSTRING(result);
}