mirror of
https://github.com/sheumann/hush.git
synced 2025-01-30 11:37:02 +00:00
optimize this a little bit.
This commit is contained in:
parent
6d13964714
commit
79a466f128
@ -25,13 +25,11 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "libbb.h"
|
#include "libbb.h"
|
||||||
|
|
||||||
|
|
||||||
void chomp(char *s)
|
void chomp(char *s)
|
||||||
{
|
{
|
||||||
char *lc = last_char_is(s, '\n');
|
if (!(s && *s)) return;
|
||||||
|
while (*s && (*s != '\n')) s++;
|
||||||
if(lc)
|
*s = 0;
|
||||||
*lc = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user