Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

isspace.c (392B)


      1 #include "../include/isspace.h"
      2 #include "../include/print.h"
      3 
      4 #define MODE "black"
      5 
      6 int k_isspace (const char *str) {
      7     if (!str || *str == '\0') return -1;
      8     int length = 0, whitespaces = 0;
      9 
     10     while (*str != '\0') {
     11         length++;
     12         if (*str == ' ') {
     13             whitespaces++;
     14         }
     15         str++;
     16     }
     17 
     18     if (length == whitespaces) return -1;
     19     else return 1;
     20 }