Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 249154b in mainline


Ignore:
Timestamp:
2012-07-20T20:22:06Z (9 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master
Children:
865a4bf
Parents:
8eff2b0
Message:

comments added and initialization changed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/testwrit/testwrit.c

    r8eff2b0 r249154b  
    4545        char *file_name;
    4646       
     47        /* Prepare some example data */
     48        memset(buffer, 0xcafebabe, BUF_SIZE);
     49
    4750        if (argc != 3) {
    4851                printf("syntax: testwrit <iterations> <target file>\n");
     
    5053        }
    5154
    52         for (i = 0; i < BUF_SIZE; ++i) {
    53                 if ((i % 64) == 0) {
    54                         buffer[i] = '\n';
    55                 } else {
    56                         buffer[i] = '.';
    57                 }
    58         }
    59 
    60         buffer[BUF_SIZE - 1] = '\n';
    61 
    6255        char *end;
    6356        iterations = strtoul(argv[1], &end, 10);
    6457        file_name = argv[2];
    6558
     59        /* Open target file */
    6660        file = fopen(file_name, "a");
    6761        if (file == NULL) {
     
    7064        }
    7165       
     66        /* Writing loop */
    7267        for (i = 0; i < iterations; ++i) {
    7368                fwrite(buffer, 1, BUF_SIZE, file);
Note: See TracChangeset for help on using the changeset viewer.