Commit 49c4f0370ba917a2608e933ca541898e9c098397

Authored by Simon Glass
1 parent 41ef372c1a

fs: Use new numeric setenv functions

Use setenv_ulong(), setenv_hex() and setenv_addr() in fs/

Signed-off-by: Simon Glass <sjg@chromium.org>

Showing 2 changed files with 2 additions and 6 deletions Side-by-side Diff

... ... @@ -256,7 +256,6 @@
256 256 unsigned long bytes;
257 257 unsigned long pos;
258 258 int len_read;
259   - char buf[12];
260 259 unsigned long time;
261 260  
262 261 if (argc < 2)
... ... @@ -308,8 +307,7 @@
308 307 }
309 308 puts("\n");
310 309  
311   - sprintf(buf, "0x%x", len_read);
312   - setenv("filesize", buf);
  310 + setenv_hex("filesize", len_read);
313 311  
314 312 return 0;
315 313 }
... ... @@ -687,7 +687,6 @@
687 687 int i;
688 688 int count;
689 689 int last_block_size = 0;
690   - char buf [10];
691 690  
692 691 c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
693 692 /* ubifs_findfile will resolve symlinks, so we know that we get
... ... @@ -740,8 +739,7 @@
740 739 if (err)
741 740 printf("Error reading file '%s'\n", filename);
742 741 else {
743   - sprintf(buf, "%X", size);
744   - setenv("filesize", buf);
  742 + setenv_hex("filesize", size);
745 743 printf("Done\n");
746 744 }
747 745