13-CF / afetch

Simple system info written in C
GNU General Public License v3.0
221 stars 39 forks source link

replace strncmp calls with static size, replace single char compare #81

Open Jan200101 opened 2 years ago

Jan200101 commented 2 years ago

calls like strncmp(osname, "Alpine Linux", 12) end up being more work than they are worth and getting the length of the const string should be gathered at compile time.

instances of strncmp with a size of 1 were simple replace with a compare, if the logic around it ensures that the pointer will not be out of bounds.