diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2014-01-06 21:30:26 -0500 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2014-01-06 21:30:26 -0500 |
commit | edc43458d797a5956f4bf39af18cf62abb0077db (patch) | |
tree | 4468c5cec42e043168aab94491bb0f2905c1855f /src/tutorial/complex.c | |
parent | 10a82cda67731941c18256e009edad4a784a2994 (diff) | |
download | postgresql-edc43458d797a5956f4bf39af18cf62abb0077db.tar.gz postgresql-edc43458d797a5956f4bf39af18cf62abb0077db.zip |
Add more use of psprintf()
Diffstat (limited to 'src/tutorial/complex.c')
-rw-r--r-- | src/tutorial/complex.c | 3 |
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); } |