Skip to content

Instantly share code, notes, and snippets.

@thoughtpolice
Created April 17, 2023 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thoughtpolice/d52c84ca67c24f53fe034e82f2f9b07a to your computer and use it in GitHub Desktop.
Save thoughtpolice/d52c84ca67c24f53fe034e82f2f9b07a to your computer and use it in GitHub Desktop.
#include <stddef.h>
char get_first_cap(const char *in, int size) {
const char *first_cap = NULL;
if (size == 0)
return ' ';
for (int i = 0 ; i++ < size && *in != 0; in++) {
if (*in >= 'A' && *in <= 'Z') {
first_cap = in;
break;
}
}
if (first_cap)
return *first_cap;
return ' ';
}
int LLVMFuzzerTestOneInput(const char *Data, long long Size) {
get_first_cap(Data, Size);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment