Menu

[424828]: / src / rtlib / str_hskip.c  Maximize  Restore  History

Download this file

29 lines (20 with data), 477 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "fb.h"
FBCALL char *fb_hStrSkipChar( char *s, ssize_t len, int c )
{
char *p = s;
if( s != NULL )
while( (--len >= 0) && ((int)*p == c) )
++p;
return p;
}
FBCALL char *fb_hStrSkipCharRev( char *s, ssize_t len, int c )
{
char *p;
if( (s == NULL) || (len <= 0) )
return s;
p = &s[len-1];
/* fixed-len's are filled with null's as in PB, strip them too */
while( (--len >= 0) && (((int)*p == c) || ((int)*p == 0) ) )
--p;
return p;
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.