mirror of
https://github.com/safishamsi/graphify.git
synced 2026-07-12 18:37:12 +00:00
81a43f028f
Java, C, C++, Ruby, C#, Kotlin, Scala, PHP via tree-sitter (13 total) benchmark.py measures BFS subgraph tokens vs corpus tokens 5 skill bug fixes (cohesion crash, dead step, missing MCP tool)
28 lines
518 B
C
28 lines
518 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#define MAX_SIZE 256
|
|
|
|
static int validate(const char *input) {
|
|
return input != NULL && strlen(input) > 0;
|
|
}
|
|
|
|
char *process(const char *input) {
|
|
if (!validate(input)) {
|
|
return NULL;
|
|
}
|
|
char *result = malloc(MAX_SIZE);
|
|
strncpy(result, input, MAX_SIZE - 1);
|
|
return result;
|
|
}
|
|
|
|
int main(int argc, char *argv[]) {
|
|
char *out = process("hello");
|
|
if (out) {
|
|
printf("%s\n", out);
|
|
free(out);
|
|
}
|
|
return 0;
|
|
}
|