1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

See ChangeLog: Sun Jan 17 11:04:33 CET 1999 Werner Koch

This commit is contained in:
Werner Koch 1999-01-17 10:06:03 +00:00
parent 38008c1c20
commit befacf7efa
19 changed files with 199 additions and 156 deletions

View file

@ -1,3 +1,7 @@
Sun Jan 17 11:04:33 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* strgutil.c (trim_trailing_ws): New.
Sat Jan 16 12:03:27 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* http.c (connect_server): Fixed stupid bug.

View file

@ -98,6 +98,7 @@ g10_errstr( int err )
X(BAD_URI ,N_("bad URI"))
X(INVALID_URI ,N_("unsupported URI"))
X(NETWORK ,N_("network error"))
X(SELFTEST_FAILED,"selftest failed")
default: p = buf; sprintf(buf, "g10err=%d", err); break;
}
#undef X

View file

@ -191,6 +191,34 @@ trim_spaces( char *str )
}
/****************
* remove trailing white spaces and return the length of the buffer
*/
unsigned
trim_trailing_ws( byte *line, unsigned len )
{
byte *p, *mark;
unsigned n;
for(mark=NULL, p=line, n=0; n < len; n++, p++ ) {
if( strchr(" \t\r\n", *p ) ) {
if( !mark )
mark = p;
}
else
mark = NULL;
}
if( mark ) {
*mark = 0;
return mark - line;
}
return len;
}
int
string_count_chr( const char *string, int c )
{