Fixed spelling mistakes
authorTheodore Tso <tytso@mit.edu>
Tue, 20 Aug 1991 19:18:43 +0000 (19:18 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 20 Aug 1991 19:18:43 +0000 (19:18 +0000)
Change to avoid fscanf() into a character array; make it go into a temporary
variable first, and then copy it in, character by character.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2190 dc483132-0cff-0310-8789-dd5450dbe970

src/admin/edit/dump.c

index 16098e3ae612fec731b4187b996695921939a2cc..25b001cd096c805e48033476da9f2029b648f960 100644 (file)
@@ -193,6 +193,7 @@ void load_db(argc, argv)
        int     load_error = 0;
        int     lineno = 0;
        int     stype, slength;
+       int     align;
        char    buf[64];        /* Must be longer than ld_vers */
        
        if (argc != 3) {
@@ -249,14 +250,14 @@ void load_db(argc, argv)
                        break;
                if (!(name = malloc(name_len+1))) {
                        com_err(argv[0], errno,
-                               "While allocating speace for name");
+                               "While allocating space for name");
                        load_error++;
                        break;
                }
                if (!(mod_name = malloc(mod_name_len+1))) {
                        free(name);
                        com_err(argv[0], errno,
-                               "While allocating speace for name");
+                               "While allocating space for name");
                        load_error++;
                        break;
                }
@@ -270,17 +271,18 @@ void load_db(argc, argv)
                        free(name);
                        free(mod_name);
                        com_err(argv[0], errno,
-                               "While allocating speace for name");
+                               "While allocating space for name");
                        load_error++;
                        break;
                }
                for (i=0; i<entry.key.length; i++) {
-                       if (fscanf(f,"%02x", entry.key.contents+i) != 1) {
+                       if (fscanf(f,"%02x", &align) != 1) {
                                fprintf(stderr, "Couldn't parse line #%d\n",
                                        lineno);
                                load_error++;
                                break;
                        }
+                       entry.key.contents[i] = align;
                }
                if (fscanf(f, "\t%u\t%u\t%u\t%u\t%u\t%s\t%u\t%u\t%u\t%u\t",
                           &entry.kvno, &entry.max_life,
@@ -301,19 +303,20 @@ void load_db(argc, argv)
                                free(mod_name);
                                xfree(entry.key.contents);
                                com_err(argv[0], errno,
-                                       "While allocating speace for the salt");
+                                       "While allocating space for the salt");
                                load_error++;
                                break;
                        }
                } else
                        entry.salt = 0;
                for (i=0; i <entry.salt_length; i++) {
-                       if (fscanf(f, "%02x", entry.salt+i) != 1) {
+                       if (fscanf(f, "%02x", &align) != 1) {
                                fprintf(stderr, "Couldn't parse line #%d\n",
                                        lineno);
                                load_error++;
                                break;
                        }
+                       entry.salt[i] = align;
                }
                if (((ch = fgetc(f)) != ';') || ((ch = fgetc(f)) != '\n')) {
                        fprintf(stderr, "Ignoring trash at end of entry: ");