This is an automated email from the ASF dual-hosted git repository.

jgemignani pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/age.git


The following commit(s) were added to refs/heads/master by this push:
     new cfec4b92 Added the toStringList() function (#1128)
cfec4b92 is described below

commit cfec4b923791de21e752474be4913412f0826ef0
Author: Marcos Silva <[email protected]>
AuthorDate: Thu Aug 10 15:59:31 2023 -0300

    Added the toStringList() function (#1128)
    
    Fixed warning due to incorrect output type specifier and
    unused variable.
---
 src/backend/utils/adt/agtype.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/backend/utils/adt/agtype.c b/src/backend/utils/adt/agtype.c
index 06166ec7..815a731a 100644
--- a/src/backend/utils/adt/agtype.c
+++ b/src/backend/utils/adt/agtype.c
@@ -6210,7 +6210,6 @@ Datum age_tostringlist(PG_FUNCTION_ARGS)
     agtype_value string_elem;
     int count;
     int i;
-    float float_num;
     char buffer[64];
 
     /* check for null */
@@ -6263,8 +6262,7 @@ Datum age_tostringlist(PG_FUNCTION_ARGS)
             break;
 
         case AGTV_FLOAT:
-
-            float_num = elem->val.float_value;
+            
             sprintf(buffer, "%.*g", DBL_DIG, elem->val.float_value);
             string_elem.val.string.val = pstrdup(buffer);
             string_elem.val.string.len = strlen(buffer);
@@ -6275,7 +6273,7 @@ Datum age_tostringlist(PG_FUNCTION_ARGS)
 
         case AGTV_INTEGER:
 
-            sprintf(buffer, "%d", elem->val.int_value);
+            sprintf(buffer, "%ld", elem->val.int_value);
             string_elem.val.string.val = pstrdup(buffer);
             string_elem.val.string.len = strlen(buffer);
 

Reply via email to