diff --git a/common/getsl.c b/common/getsl.c new file mode 100644 index 0000000..8ca738f --- /dev/null +++ b/common/getsl.c @@ -0,0 +1,12 @@ +#include "tweak.h" +#include +#include "my-string.h" +#include "common_def.h" +#include "co_extern.h" + +char *getsl(char *s, int l) { + int i; + char *rv = fgets(s, l, stdin); + if(rv && (i = strlen(rv)) > 0) if(rv[i - 1] == '\n') rv[i - 1] = '\0'; + return rv; +}