Changeset 1ea8566 in mainline


Ignore:
Timestamp:
2024-12-18T16:47:06Z (11 months ago)
Author:
Nataliia Korop <n.corop08@…>
Children:
fc632e8
Parents:
01ccd702
Message:

parse sizes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/pcapcat/main.c

    r01ccd702 r1ea8566  
    2929#include <stdint.h>
    3030#include <stdio.h>
     31#include <stdlib.h>
    3132#include <time.h>
    3233#include <stdbool.h>
     
    8485        }
    8586        printf("0x%x: %d, %d\n", hdr.magic_stamp, hdr.captured_length, hdr.original_length);
    86 
    87         fread(NULL, 1, (size_t)hdr.captured_length, f);
    88         printf("After\n");
     87        void *data = malloc(hdr.captured_length);
     88        fread(data, 1, (size_t)hdr.captured_length, f);
     89        free(data);
    8990        read_bytes = fread(&hdr, 1, sizeof(pcap_packet_header_t), f);
    9091    }
Note: See TracChangeset for help on using the changeset viewer.