Mercurial > hg > mlmmj
view src/chomp.c @ 0:21ce01de8109
Initial revision
author | mmj |
---|---|
date | Thu, 22 Apr 2004 04:02:09 +1000 |
parents | |
children | 3f177909efc8 |
line wrap: on
line source
/* Copyright (C) 2002, 2003 Mads Martin Joergensen <mmj at mmj.dk> * * $Id$ * * This file is redistributable under version 2 of the GNU General * Public License as described at http://www.gnu.org/licenses/gpl.txt */ #include <string.h> #include "chomp.h" char *chomp(char *str) { int i = strlen(str) - 1; while(str[i] == '\n') { str[i] = 0; i--; } return str; }