Initial revision
This commit is contained in:
parent
7765fb7881
commit
9f33826734
12
common/getsl.c
Normal file
12
common/getsl.c
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#include "tweak.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#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;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user