tests: Fix function signatures

This commit is contained in:
Tibor Nagy
2019-02-20 19:27:18 +01:00
parent 97592716fb
commit ff874c87d7
104 changed files with 119 additions and 126 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
#include <stdlib.h>
#include <string.h>
int main(int argc, char ** argv) {
int main(void) {
puts("# mem #");
char arr[100];
memset(arr, 0, 100); // Compiler builtin, should work
+1 -1
View File
@@ -1,7 +1,7 @@
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
int main(void) {
char dest1[12] = "hello";
printf("%s\n", strcat(dest1, " world")); // should be hello world
+1 -1
View File
@@ -1,7 +1,7 @@
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
int main(void) {
printf("%s\n", strchr("hello", 'e')); // should be ello
printf("%s\n", strchr("world", 'l')); // should be ld
printf("%i\n", strchr("world", 0) == NULL); // should be 1
+1 -1
View File
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <string.h>
int main() {
int main(void) {
char dst[20];
strcpy(dst, "strcpy works!");
+1 -1
View File
@@ -1,7 +1,7 @@
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
int main(void) {
char *world = "world";
printf("%ld\n", strcspn("hello", world)); // should be 2
printf("%ld\n", strcspn("banana", world)); // should be 6
+1 -1
View File
@@ -1,7 +1,7 @@
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
int main(void) {
printf("%d\n", strncmp("a", "aa", 2));
printf("%d\n", strncmp("a", "", 2));
printf("%d\n", strncmp("\xFF", "\xFE", 2));
+1 -1
View File
@@ -1,7 +1,7 @@
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
int main(void) {
char* source = "The quick drawn fix jumps over the lazy bug";
// should be "The quick drawn fix jumps over the lazy bug"
+1 -2
View File
@@ -1,8 +1,7 @@
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
int main(void) {
char s0[] = "hello, world";
char* ptr = strrchr(s0, 'l');
if (ptr != &s0[10]) {
+1 -1
View File
@@ -1,7 +1,7 @@
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
int main(void) {
char *hello = "hello";
char *world = "world";
char *banana = "banana";
+1 -1
View File
@@ -1,7 +1,7 @@
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
int main(void) {
printf("%s\n", strstr("In relibc we trust", "rust"));
printf("%s\n", strstr("In relibc we trust", "libc"));
printf("%s\n", strstr("In relibc we trust", "bugs"));
+1 -1
View File
@@ -1,7 +1,7 @@
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
int main(void) {
char source[] = "I'd just like to interject for a moment. What you're referring to as Linux, "
"is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux.\n";
+1 -1
View File
@@ -1,7 +1,7 @@
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
int main(void) {
char source[] = "I'd just like to interject for a moment. What you're referring to as Linux, "
"is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux.\n";
char* sp;