-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix mulle_snprintf in truncation case
- Loading branch information
Showing
15 changed files
with
222 additions
and
44 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
### 3.2.1 | ||
|
||
* fix `mulle_snprintf` in truncation case | ||
|
||
## 3.2.0 | ||
|
||
* unified printing of nan across platforms | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.3.0 | ||
5.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include <mulle-sprintf/mulle-sprintf.h> | ||
#include <mulle-testallocator/mulle-testallocator.h> | ||
|
||
#include <stdio.h> | ||
#include <errno.h> | ||
|
||
|
||
|
||
static void snprintf_string_test( char *buf, size_t len, char *text) | ||
{ | ||
int rval; | ||
|
||
errno = 0; | ||
rval = snprintf( buf, len, "%s", text); | ||
printf( "snprintf : %zd \"%s\" (%d-%d)\n", len, buf, rval, errno); | ||
} | ||
|
||
|
||
static void mulle_snprintf_string_test( char *buf, size_t len, char *text) | ||
{ | ||
int rval; | ||
|
||
errno = 0; | ||
rval = mulle_snprintf( buf, len, "%s", text); | ||
printf( "mulle_snprintf : %zd \"%s\" (%d-%d)\n", len, buf, rval, errno); | ||
} | ||
|
||
|
||
|
||
int main() | ||
{ | ||
char buf[ 18]; | ||
size_t i; | ||
|
||
for( i = sizeof( buf); i;) | ||
{ | ||
--i; | ||
|
||
memset( buf, '*', sizeof( buf) - 1); | ||
buf[ 15] = 0; | ||
snprintf_string_test( buf, i, "VfL Bochum 1848"); | ||
|
||
memset( buf, '*', sizeof( buf) - 1); | ||
buf[ 15] = 0; | ||
mulle_snprintf_string_test( buf, i, "VfL Bochum 1848"); | ||
} | ||
|
||
return( 0); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
snprintf : 17 "VfL Bochum 1848" (15-0) | ||
mulle_snprintf : 17 "VfL Bochum 1848" (15-0) | ||
snprintf : 16 "VfL Bochum 1848" (15-0) | ||
mulle_snprintf : 16 "VfL Bochum 1848" (15-0) | ||
snprintf : 15 "VfL Bochum 184" (15-0) | ||
mulle_snprintf : 15 "VfL Bochum 184" (-1-12) | ||
snprintf : 14 "VfL Bochum 18" (15-0) | ||
mulle_snprintf : 14 "VfL Bochum 18" (-1-12) | ||
snprintf : 13 "VfL Bochum 1" (15-0) | ||
mulle_snprintf : 13 "VfL Bochum 1" (-1-12) | ||
snprintf : 12 "VfL Bochum " (15-0) | ||
mulle_snprintf : 12 "VfL Bochum " (-1-12) | ||
snprintf : 11 "VfL Bochum" (15-0) | ||
mulle_snprintf : 11 "VfL Bochum" (-1-12) | ||
snprintf : 10 "VfL Bochu" (15-0) | ||
mulle_snprintf : 10 "VfL Bochu" (-1-12) | ||
snprintf : 9 "VfL Boch" (15-0) | ||
mulle_snprintf : 9 "VfL Boch" (-1-12) | ||
snprintf : 8 "VfL Boc" (15-0) | ||
mulle_snprintf : 8 "VfL Boc" (-1-12) | ||
snprintf : 7 "VfL Bo" (15-0) | ||
mulle_snprintf : 7 "VfL Bo" (-1-12) | ||
snprintf : 6 "VfL B" (15-0) | ||
mulle_snprintf : 6 "VfL B" (-1-12) | ||
snprintf : 5 "VfL " (15-0) | ||
mulle_snprintf : 5 "VfL " (-1-12) | ||
snprintf : 4 "VfL" (15-0) | ||
mulle_snprintf : 4 "VfL" (-1-12) | ||
snprintf : 3 "Vf" (15-0) | ||
mulle_snprintf : 3 "Vf" (-1-12) | ||
snprintf : 2 "V" (15-0) | ||
mulle_snprintf : 2 "V" (-1-12) | ||
snprintf : 1 "" (15-0) | ||
mulle_snprintf : 1 "" (-1-12) | ||
snprintf : 0 "***************" (15-0) | ||
mulle_snprintf : 0 "***************" (-1-22) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <mulle-sprintf/mulle-sprintf.h> | ||
#include <mulle-testallocator/mulle-testallocator.h> | ||
|
||
#include <stdio.h> | ||
|
||
// just a copy from snprintf mindlessly changed to sprintf | ||
|
||
static void sprintf_string_test( char *buf, size_t len, char *text) | ||
{ | ||
memset( buf, '*', len); | ||
sprintf( buf, "%s", text); | ||
printf( "sprintf: %zd \"%s\"\n", len, text); | ||
|
||
memset( buf, '*', len); | ||
mulle_sprintf( buf, "%s", text); | ||
printf( "mulle_sprintf: %zd \"%s\"\n", len, buf); | ||
} | ||
|
||
|
||
|
||
int main() | ||
{ | ||
char buf[ 16]; | ||
size_t i; | ||
|
||
for( i = 0; i < sizeof( buf); i++) | ||
sprintf_string_test( buf, i, "VfL Bochum 1848"); | ||
|
||
return( 0); | ||
} | ||
|
Oops, something went wrong.