blob: 3757bff2e3867b9ff77709c84c7d488605430da5 [file] [log] [blame]
Eric Andersenaad1a882001-03-16 22:47:14 +00001/* vi: set sw=4 ts=4: */
2/*
3 * Utility routines.
4 *
Eric Andersenc7bda1c2004-03-15 08:29:22 +00005 * Copyright (C) many different people.
Eric Andersencb81e642003-07-14 21:21:08 +00006 * If you wrote this, please acknowledge your work.
Eric Andersenaad1a882001-03-16 22:47:14 +00007 *
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02008 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
Eric Andersenaad1a882001-03-16 22:47:14 +00009 */
Eric Andersenaad1a882001-03-16 22:47:14 +000010#include "libbb.h"
11
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +000012void FAST_FUNC chomp(char *s)
Eric Andersenaad1a882001-03-16 22:47:14 +000013{
Matt Kraai0733e842002-01-02 18:51:23 +000014 char *lc = last_char_is(s, '\n');
Eric Andersenc7bda1c2004-03-15 08:29:22 +000015
Denis Vlasenko067e3f02006-11-10 23:25:53 +000016 if (lc)
Denis Vlasenko7e84e532007-05-08 17:52:17 +000017 *lc = '\0';
Eric Andersenaad1a882001-03-16 22:47:14 +000018}