Prettify strpbrk and strstr tests

This commit is contained in:
Andrii Zymohliad
2018-03-12 18:22:39 +08:00
parent 1e969afd43
commit c4620be999
2 changed files with 13 additions and 14 deletions
+6 -6
View File
@@ -3,16 +3,16 @@
int main(int argc, char* argv[]) {
// should be "rust"
char* str1 = strstr("In relibc we trust", "rust");
printf("%s\n", (str1) ? str1 : "NULL");
char* res1 = strstr("In relibc we trust", "rust");
printf("%s\n", (res1) ? res1 : "NULL");
// should be "libc we trust"
char* str2 = strstr("In relibc we trust", "libc");
printf("%s\n", (str2) ? str2 : "NULL");
char* res2 = strstr("In relibc we trust", "libc");
printf("%s\n", (res2) ? res2 : "NULL");
// should be "NULL"
char* str3 = strstr("In relibc we trust", "bugs");
printf("%s\n", (str3) ? str3 : "NULL");
char* res3 = strstr("In relibc we trust", "bugs");
printf("%s\n", (res3) ? res3 : "NULL");
return 0;
}