aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2023-01-11 22:45:20 +0000
committerstephan <stephan@noemail.net>2023-01-11 22:45:20 +0000
commita7c498599f917607542bcd7003c445723aba9127 (patch)
treee96d905dffd46e39667d019e1f2cc8a4a31358ff /src/util.c
parent60a1a0f7df99e03bba7abc45f526e372c20d2fdc (diff)
parent8518eaccd79ae83a55fad3c3fa545beb16fb127c (diff)
downloadsqlite-a7c498599f917607542bcd7003c445723aba9127.tar.gz
sqlite-a7c498599f917607542bcd7003c445723aba9127.zip
Merge trunk into wasi-patches branch and add missing yes/no result to the configure script's output for the --with-wasi-sdk=PATH test.
FossilOrigin-Name: adc0ede0a43241b85563408d0de8e640a75ec4f7bdfe5e48acc5cdd6b182b88c
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c
index 72faafea5..23c6b1a66 100644
--- a/src/util.c
+++ b/src/util.c
@@ -632,11 +632,14 @@ do_atof_calc:
#endif
/*
-** Render an signed 64-bit integer as text. Store the result in zOut[].
+** Render an signed 64-bit integer as text. Store the result in zOut[] and
+** return the length of the string that was stored, in bytes. The value
+** returned does not include the zero terminator at the end of the output
+** string.
**
** The caller must ensure that zOut[] is at least 21 bytes in size.
*/
-void sqlite3Int64ToText(i64 v, char *zOut){
+int sqlite3Int64ToText(i64 v, char *zOut){
int i;
u64 x;
char zTemp[22];
@@ -653,6 +656,7 @@ void sqlite3Int64ToText(i64 v, char *zOut){
}while( x );
if( v<0 ) zTemp[i--] = '-';
memcpy(zOut, &zTemp[i+1], sizeof(zTemp)-1-i);
+ return sizeof(zTemp)-2-i;
}
/*