]> eyrie.org Git - kerberos/krb5-strength.git/blob - cracklib/stringlib.c
Add NEWS entry for spec file
[kerberos/krb5-strength.git] / cracklib / stringlib.c
1 /*
2  * This program is copyright Alec Muffett 1993. The author disclaims all 
3  * responsibility or liability with respect to it's usage or its effect 
4  * upon hardware or computer systems, and maintains copyright as set out 
5  * in the "LICENCE" document which accompanies distributions of Crack v4.0 
6  * and upwards.
7  */
8
9 /*
10  * Modified as part of the krb5-strength project as follows:
11  *
12  * 2007-03-23  Russ Allbery <eagle@eyrie.org>
13  *   - Additional system includes for other functions.
14  * 2009-10-14  Russ Allbery <eagle@eyrie.org>
15  *   - Add ANSI C protototypes for all functions.
16  *   - Remove unused Clone function.
17  * 2016-11-06  Russ Allbery <eagle@eyrie.org>
18  *   - Remove unused vers_id to silence GCC warnings.
19  */
20
21 #include <string.h>
22 #include <stdlib.h>
23
24 #include "packer.h"
25
26 char
27 Chop(char *string)
28 {
29     register char c;
30     register char *ptr;
31     c = '\0';
32
33     for (ptr = string; *ptr; ptr++);
34     if (ptr != string)
35     {
36         c = *(--ptr);
37         *ptr = '\0';
38     }
39     return (c);
40 }
41
42 char *
43 Trim(char *string)
44 {
45     register char *ptr;
46     for (ptr = string; *ptr; ptr++);
47
48     while ((--ptr >= string) && isspace(*ptr));
49
50     *(++ptr) = '\0';
51
52     return (ptr);
53 }