All pastes #939510 Raw Edit

Something

public c v1 · immutable
·published 2008-03-12 10:49 UTC
rendered paste body
char *mygetline(char *line, int size){   if ( fgets(line, size, stdin) )     {       char *newline = strchr(line, '\n'); // check for trailing '\n'        if ( newline )	 {	   *newline =  '\0'; // overwrite the '\n' with a terminating null       }     }   return line;}