mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -05:00
Fix format specifiers for 64bit integers
Use "%" PRIu64 from inttypes.h instead of "%lld" which is incorrect on 64bit platforms.
This commit is contained in:
parent
311eb19cb5
commit
ea36855793
@ -36,6 +36,7 @@
|
|||||||
#ifdef HAVE_STDINT_H
|
#ifdef HAVE_STDINT_H
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "daapd.h"
|
#include "daapd.h"
|
||||||
#include "err.h"
|
#include "err.h"
|
||||||
@ -815,8 +816,8 @@ int db_sql_add(char **pe, MP3FILE *pmp3, int *id) {
|
|||||||
pmp3->time_played=0;
|
pmp3->time_played=0;
|
||||||
|
|
||||||
/* sqlite2 doesn't support 64 bit ints */ /* JB: FIXME */
|
/* sqlite2 doesn't support 64 bit ints */ /* JB: FIXME */
|
||||||
sprintf(sample_count,"%lld",pmp3->sample_count);
|
sprintf(sample_count, "%" PRIu64, pmp3->sample_count);
|
||||||
sprintf(file_size,"%lld",pmp3->file_size);
|
sprintf(file_size, "%" PRIu64, pmp3->file_size);
|
||||||
|
|
||||||
err=db_sql_exec_fn(pe,E_DBG,"INSERT INTO songs VALUES "
|
err=db_sql_exec_fn(pe,E_DBG,"INSERT INTO songs VALUES "
|
||||||
"(NULL," // id
|
"(NULL," // id
|
||||||
@ -941,8 +942,8 @@ int db_sql_update(char **pe, MP3FILE *pmp3, int *id) {
|
|||||||
|
|
||||||
pmp3->db_timestamp = (int)time(NULL);
|
pmp3->db_timestamp = (int)time(NULL);
|
||||||
|
|
||||||
sprintf(sample_count,"%lld",pmp3->sample_count);
|
sprintf(sample_count, "%" PRIu64, pmp3->sample_count);
|
||||||
sprintf(file_size,"%lld",pmp3->file_size);
|
sprintf(file_size, "%" PRIu64, pmp3->file_size);
|
||||||
|
|
||||||
strcpy(query,"UPDATE songs SET "
|
strcpy(query,"UPDATE songs SET "
|
||||||
"title='%q'," // title
|
"title='%q'," // title
|
||||||
|
Loading…
Reference in New Issue
Block a user