0.3.0: converge relibc to upstream 0.6.0 + Red Bear patches
This commit is contained in:
+28
-13
@@ -5,27 +5,42 @@
|
||||
#include "test_helpers.h"
|
||||
|
||||
int main(void) {
|
||||
printf("%ld\n", strtol(" -42", NULL, 0));
|
||||
printf("%ld\n", strtol(" +555", NULL, 0));
|
||||
printf("%ld\n", strtol(" 1234567890 ", NULL, 0));
|
||||
char *endptr;
|
||||
|
||||
printf("%ld\n", strtol(" -42", NULL, 10));
|
||||
printf("%ld\n", strtol(" +555", NULL, 10));
|
||||
printf("%ld\n", strtol(" 1234567890 ", NULL, 10));
|
||||
printf("%ld\n", strtol(" -42", &endptr, 0));
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
printf("%ld\n", strtol(" +555", &endptr, 0));
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
printf("%ld\n", strtol(" 1234567890 ", &endptr, 0));
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
|
||||
printf("%lx\n", strtol(" 0x38Acfg", NULL, 0));
|
||||
printf("%lx\n", strtol("0Xabcdef12", NULL, 16));
|
||||
printf("%lx\n", strtol("cafebeef", NULL, 16));
|
||||
printf("%ld\n", strtol(" -42", &endptr, 10));
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
printf("%ld\n", strtol(" +555", &endptr, 10));
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
printf("%ld\n", strtol(" 1234567890 ", &endptr, 10));
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
|
||||
printf("%lo\n", strtol(" 073189", NULL, 0));
|
||||
printf("%lo\n", strtol(" 073189", NULL, 8));
|
||||
printf("%lx\n", strtol(" 0x38Acfg", &endptr, 0));
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
printf("%lx\n", strtol("0Xabcdef12", &endptr, 16));
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
printf("%lx\n", strtol("cafebeef", &endptr, 16));
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
|
||||
printf("%lo\n", strtol(" 0b", NULL, 8));
|
||||
printf("%lo\n", strtol(" 073189", &endptr, 0));
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
printf("%lo\n", strtol(" 073189", &endptr, 8));
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
|
||||
printf("%lo\n", strtol(" 0b", &endptr, 8));
|
||||
if(errno != 0) {
|
||||
printf("errno is not 0 (%d), something went wrong\n", errno);
|
||||
}
|
||||
printf("%lo\n", strtol(" 0b", NULL, 0));
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
printf("%lo\n", strtol(" 0b", &endptr, 0));
|
||||
if(errno != 0) {
|
||||
printf("errno is not 0 (%d), something went wrong\n", errno);
|
||||
}
|
||||
printf("endptr \"%s\"\n", endptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user