#include #include #include void main(){ char l1 = 'b'; char buffer[1024]; char l2 = 'c'; for(int i = 0; i < sizeof(buffer); i++) buffer[i] = 'z'; int fd = open("readfile_wrong.c", O_RDONLY); ssize_t readlen = read(fd, buffer, sizeof(buffer)); close(fd); write(1, buffer, readlen); char other_buffer[1024]; size_t copylen = sizeof(other_buffer) > sizeof(buffer)? sizeof(buffer):sizeof(other_buffer); strncpy(other_buffer, buffer, copylen); }