diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-04-22 15:05:11 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-04-22 15:05:11 +0400 |
commit | 6c5e4c9bc0d9ac30f7ec7ee334630bacb58687ba (patch) | |
tree | 684b2410e4d2e612f2f3640e345499a5d3e79b7d /storage | |
parent | 279b50b4eb69f882510f069e79715c38dc13355e (diff) | |
download | mariadb-git-6c5e4c9bc0d9ac30f7ec7ee334630bacb58687ba.tar.gz |
Fixing -Werror=format-overflow errors (found by gcc-8.3.1)
Diffstat (limited to 'storage')
-rw-r--r-- | storage/maria/ma_test3.c | 2 | ||||
-rw-r--r-- | storage/maria/maria_chk.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_test3.c | 2 | ||||
-rw-r--r-- | storage/myisam/myisamchk.c | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/storage/maria/ma_test3.c b/storage/maria/ma_test3.c index f81d5363c6b..604c2b676a4 100644 --- a/storage/maria/ma_test3.c +++ b/storage/maria/ma_test3.c @@ -362,7 +362,7 @@ int test_write(MARIA_HA *file,int id,int lock_type) maria_extra(file,HA_EXTRA_WRITE_CACHE,0); } - sprintf((char*) record.id,"%7ld", (long) getpid()); + my_snprintf((char*) record.id, sizeof(record.id), "%7ld", (long) getpid()); strnmov((char*) record.text,"Testing...", sizeof(record.text)); tries=(uint) rnd(100)+10; diff --git a/storage/maria/maria_chk.c b/storage/maria/maria_chk.c index d03c50891df..76edacee964 100644 --- a/storage/maria/maria_chk.c +++ b/storage/maria/maria_chk.c @@ -1699,8 +1699,8 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name) null_bit[0]=null_pos[0]=0; if (keyseg->null_bit) { - sprintf(null_bit,"%d",keyseg->null_bit); - sprintf(null_pos,"%ld",(long) keyseg->null_pos+1); + my_snprintf(null_bit, sizeof(null_bit), "%d", keyseg->null_bit); + my_snprintf(null_pos, sizeof(null_pos), "%ld", (long) keyseg->null_pos+1); } printf("%-7ld%-5d%-9s%-10s%-30s\n", (long) keyseg->start+1,keyseg->length, diff --git a/storage/myisam/mi_test3.c b/storage/myisam/mi_test3.c index e05398f7c4a..86a639ad2b0 100644 --- a/storage/myisam/mi_test3.c +++ b/storage/myisam/mi_test3.c @@ -364,7 +364,7 @@ int test_write(MI_INFO *file,int id,int lock_type) mi_extra(file,HA_EXTRA_WRITE_CACHE,0); } - sprintf((char*) record.id,"%7ld",(long) getpid()); + my_snprintf((char*) record.id, sizeof(record.id), "%7ld", (long) getpid()); strnmov((char*) record.text,"Testing...", sizeof(record.text)); tries=(uint) rnd(100)+10; diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index dfff5720847..74e29a7621f 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -1404,8 +1404,8 @@ static void descript(HA_CHECK *param, register MI_INFO *info, char * name) null_bit[0]=null_pos[0]=0; if (keyseg->null_bit) { - sprintf(null_bit,"%d",keyseg->null_bit); - sprintf(null_pos,"%ld",(long) keyseg->null_pos+1); + my_snprintf(null_bit, sizeof(null_bit), "%d", keyseg->null_bit); + my_snprintf(null_pos, sizeof(null_pos), "%ld", (long) keyseg->null_pos+1); } printf("%-7ld%-5d%-9s%-10s%-30s\n", (long) keyseg->start+1,keyseg->length, |