gnome-control-center/capplets/about-me/cracklib/stringlib.c
Diego González a6352fc137 Lots of changes on the password dialog and a bit of a performance improvement
on the main dialog while instant applying the changes to the EDS database.
2005-06-15 00:25:55 +00:00

52 lines
1,005 B
C

/*
* This program is copyright Alec Muffett 1993. The author disclaims all
* responsibility or liability with respect to it's usage or its effect
* upon hardware or computer systems, and maintains copyright as set out
* in the "LICENCE" document which accompanies distributions of Crack v4.0
* and upwards.
*/
#include "packer.h"
static char vers_id[] = "stringlib.c : v2.3p2 Alec Muffett 18 May 1993";
char
Chop(register char *string)
{
register char c;
register char *ptr;
c = '\0';
for (ptr = string; *ptr; ptr++);
if (ptr != string)
{
c = *(--ptr);
*ptr = '\0';
}
return (c);
}
char *
Trim(register char *string)
{
register char *ptr;
for (ptr = string; *ptr; ptr++);
while ((--ptr >= string) && isspace(*ptr));
*(++ptr) = '\0';
return (ptr);
}
char *
Clone (char *string)
{
register char *retval;
retval = (char *) malloc(strlen(string) + 1);
if (retval)
{
strcpy(retval, string);
}
return (retval);
}