8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / pam_modules / authtok_check / stringlib.c
blob9027af41a9380ab9858a663fcfa96c78bc8fc781
1 /*
2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
6 #pragma ident "%Z%%M% %I% %E% SMI"
8 /*
9 * This program is copyright Alec Muffett 1993. The author disclaims all
10 * responsibility or liability with respect to it's usage or its effect
11 * upon hardware or computer systems, and maintains copyright as set out
12 * in the "LICENCE" document which accompanies distributions of Crack v4.0
13 * and upwards.
16 #include "packer.h"
19 char
20 Chop(register char *string)
22 register char c;
23 register char *ptr;
25 c = '\0';
27 for (ptr = string; *ptr; ptr++);
28 if (ptr != string) {
29 c = *(--ptr);
30 *ptr = '\0';
32 return (c);
35 char
36 Chomp(register char *string)
38 register char c;
39 register char *ptr;
41 c = '\0';
43 for (ptr = string; *ptr; ptr++)
45 if (ptr != string && isspace(*(--ptr))) {
46 c = *ptr;
47 *ptr = '\0';
49 return (c);
53 char *
54 Trim(register char *string)
56 register char *ptr;
58 for (ptr = string; *ptr; ptr++);
60 while ((--ptr >= string) && isspace(*ptr));
62 *(++ptr) = '\0';
64 return (ptr);