Compare commits
2 Commits
b35703d936
...
708278be7d
Author | SHA1 | Date |
---|---|---|
Jacob Windle | 708278be7d | |
Jacob Windle | 7a49b40b3e |
4
main.c
4
main.c
|
@ -43,15 +43,13 @@ FILE *fopenHostsFile(char *mode) {
|
|||
* @param hostsFile
|
||||
*/
|
||||
void modifyHostsFile(char *oldhost, char *newhost, int deleteHost) {
|
||||
FILE *hostsFile = fopenHostsFile("r");
|
||||
FILE *hostsFile = fopenHostsFile("r+");
|
||||
char buf[256];
|
||||
char *ptr, *f;
|
||||
|
||||
char newHostsFile[4096];
|
||||
memset(newHostsFile, 0, 4096);
|
||||
|
||||
// fseek(hostsFile, 0, SEEK_SET);
|
||||
|
||||
while (fgets(buf, 256, hostsFile) != NULL)
|
||||
{
|
||||
f = strcasestr(buf, oldhost);
|
||||
|
|
Loading…
Reference in New Issue