~ubuntu-branches/ubuntu/raring/ecryptfs-utils/raring

« back to all changes in this revision

Viewing changes to src/utils/mount.ecryptfs_private.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2011-11-08 10:47:03 UTC
  • Revision ID: package-import@ubuntu.com-20111108104703-1wb4mc465jtebtek
Tags: 93-0ubuntu2
fix infinite loop on arm: fgetc returns an int, and -1 at end of
options.  Arm makes char unsigned. (LP: #884407)

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
/* Read ecryptfs signature from file and validate
135
135
 * Return signature as a string, or NULL on failure
136
136
 */
137
 
        char *sig_file, c;
 
137
        char *sig_file;
 
138
        int c;
138
139
        FILE *fh;
139
140
        char *sig;
140
141
        int i;
168
169
        while ((c = fgetc(fh)) != EOF && i < KEY_BYTES) {
169
170
                if ((c>='0' && c<='9') || (c>='a' && c<='f') ||
170
171
                    (c>='A' && c<='F')) {
171
 
                        sig[i] = c;
 
172
                        sig[i] = (char)c;
172
173
                        i++;
173
174
                } else {
174
175
                        fputs("Invalid hex signature\n", stderr);