readdat.c
来自「用C语言编的邮件系统(毕业论文)」· C语言 代码 · 共 20 行
C
20 行
#include "mail.h"/* Read the current data record into the data buffer. * Return a pointer to the null-terminated data buffer. */char *_mail_readdat(MAIL *mail){ if (lseek(mail->datfd, mail->datoff, SEEK_SET) == -1) err_dump("lseek error"); if (read(mail->datfd, mail->datbuf, mail->datlen) != mail->datlen) err_dump("read error"); if (mail->datbuf[mail->datlen - 1] != '\n') /* sanity check */ err_dump("missing newline"); mail->datbuf[mail->datlen - 1] = 0; /* replace newline with null */ return(mail->datbuf); /* return pointer to data record */}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?