News for hackers. Stuff that matters.
Re:An usable and maximally efficient C standard library by saagarjha on Monday December 04, 2023 @05:51PM (#38524300)
This is cute, and probably useful for hobby projects. If I may, it would be nice to have slightly more generic versions of some of the interfaces, and perhaps consider dropping "maximally" efficient from your tagline. Not only is it cleaner, you are less likely to get yelled at by people who focus on code like this:

  /* Function to concatenate multiple strings into a new string */
  static inline char *concatenate(const char *str1, const char *str2)
  {
      size_t len1 = strlen(str1);
      size_t len2 = strlen(str2);
  
      char *result = (char *)malloc(len1 + len2 + 1);
      strcpy(result, str1);
      strcat(result, str2);
  
      return result;
  }

There are no comments on this comment yet.