Fixed tabs

This commit is contained in:
James Booth
2015-03-23 23:42:04 +00:00
parent 73e1654f28
commit 027fa2a700

View File

@@ -177,23 +177,23 @@ p_gpg_sign_str(const char * const str, const char * const fp)
static char* static char*
_remove_header_footer(char *str) _remove_header_footer(char *str)
{ {
char *pointer = str; char *pointer = str;
int newlines = 0; int newlines = 0;
while (newlines < 3) { while (newlines < 3) {
if (pointer[0] == '\n') { if (pointer[0] == '\n') {
newlines++; newlines++;
} }
pointer++; pointer++;
if (strlen(pointer) == 0) { if (strlen(pointer) == 0) {
return NULL; return NULL;
} }
} }
char *stripped = malloc(strlen(pointer)+1-strlen(PGP_FOOTER)); char *stripped = malloc(strlen(pointer)+1-strlen(PGP_FOOTER));
strncpy(stripped,pointer,strlen(pointer)-strlen(PGP_FOOTER)); strncpy(stripped,pointer,strlen(pointer)-strlen(PGP_FOOTER));
stripped[strlen(pointer)-strlen(PGP_FOOTER)] = '\0'; stripped[strlen(pointer)-strlen(PGP_FOOTER)] = '\0';
return stripped; return stripped;
} }