blob: 6165b83bca649d1ab80a9a188ed6b0764d32a04a [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 *
Bernhard Reutner-Fischerb1629b12006-05-19 19:29:19 +00008 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
Eric Andersenaad1a882001-03-16 22:47:14 +00009 */
10
11#include <stdio.h>
Eric Andersen08ff8a42001-03-23 17:02:05 +000012#include <string.h>
Eric Andersenaad1a882001-03-16 22:47:14 +000013#include "libbb.h"
14
Matt Kraai0733e842002-01-02 18:51:23 +000015
Eric Andersenaad1a882001-03-16 22:47:14 +000016void chomp(char *s)
17{
Matt Kraai0733e842002-01-02 18:51:23 +000018 char *lc = last_char_is(s, '\n');
Eric Andersenc7bda1c2004-03-15 08:29:22 +000019
Matt Kraai0733e842002-01-02 18:51:23 +000020 if(lc)
21 *lc = 0;
Eric Andersenaad1a882001-03-16 22:47:14 +000022}