/* * solid_helpers.c — small Solid-C compatibility helpers. * * dec8 / dec16 / dec32 / hex8 / hex16 / hex32 are in dec_hex.c (compact * asm port from solid-c's STDLIB.ASM, ~150 bytes total — vs ~3-5 KB if * routed through printf). This file now only holds gets(). */ #include /* ---- gets — dangerous but Solid-C provides it ---------------------- */ char *gets(char *buf) { int i = 0; int c; for (;;) { c = getchar(); if (c == EOF) { if (i == 0) return 0; break; } if (c == '\n' || c == '\r') break; buf[i++] = (char)c; } buf[i] = 0; return buf; }