From 34ed1e8121c2eb14f862c2e74e03de180c4fd450 Mon Sep 17 00:00:00 2001 From: tTh Date: Sun, 27 Nov 2022 10:29:55 +0100 Subject: [PATCH] cosmetic --- Hexdiff/Makefile | 3 +-- Hexdiff/fileinfo.c | 4 ++-- Hexdiff/fonctions.c | 10 ++++------ Hexdiff/sel_file.c | 4 ++-- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Hexdiff/Makefile b/Hexdiff/Makefile index 7967d97..bb0d30d 100644 --- a/Hexdiff/Makefile +++ b/Hexdiff/Makefile @@ -51,8 +51,7 @@ hexdiff: Makefile $(OBJECTS) install: cp hexdiff hexdiff.install strip hexdiff.install - cp hexdiff.install $(OU_LE_METTRE)/bin/hexdiff - rm hexdiff.install + mv hexdiff.install $(OU_LE_METTRE)/bin/hexdiff cp hexdiff.1 $(OU_LE_METTRE)/man/man1/hexdiff.1 @echo "you can copy hexdiff.rc in your HOME as .hexdiffrc" diff --git a/Hexdiff/fileinfo.c b/Hexdiff/fileinfo.c index 6cbc9e4..4332c5b 100644 --- a/Hexdiff/fileinfo.c +++ b/Hexdiff/fileinfo.c @@ -28,9 +28,9 @@ static void prtime(time_t t, char *pstr) { struct tm *ptm; -int foo; + ptm = gmtime(&t); -foo = strftime(pstr, 99, "%Y-%m-%d %H:%M:%S", ptm); +strftime(pstr, 99, "%Y-%m-%d %H:%M:%S", ptm); } /*----------------------------------------------------------------*/ #define W_FILEINFO 48 diff --git a/Hexdiff/fonctions.c b/Hexdiff/fonctions.c index 17bc013..fde1fc9 100644 --- a/Hexdiff/fonctions.c +++ b/Hexdiff/fonctions.c @@ -33,17 +33,14 @@ struct stat statbuf; Fichier *fichier; long offset; -if ( (fd=open(nom, O_RDONLY)) < 0) - { +if ( (fd=open(nom, O_RDONLY)) < 0) { return 0; } -if (fenetre_active==0) - { +if (fenetre_active==0) { fichier = &f1; offset = f2.offset; } -else - { +else { fichier = &f2; offset = f1.offset; } @@ -57,6 +54,7 @@ close(fichier->fd); */ strncpy(fichier->nom, nom, T_NOM); foo = fstat(fd, &statbuf); +if (foo) perror(__func__); fichier->fd = fd; fichier->taille = statbuf.st_size; fichier->offset = offset; diff --git a/Hexdiff/sel_file.c b/Hexdiff/sel_file.c index 3d3016f..9802057 100644 --- a/Hexdiff/sel_file.c +++ b/Hexdiff/sel_file.c @@ -45,6 +45,7 @@ static int teste_dirent(const struct dirent *de, struct stat *pstat) int foo; foo = stat(de->d_name, pstat); +if (foo) perror(__func__); if (S_ISDIR(pstat->st_mode)) return 0; @@ -109,7 +110,6 @@ static int liste_fichiers(WINDOW *win, int flag) DIR *dir; struct dirent *de; struct stat statbuf; -int foo; /* * initializing local vars, for list-of-files @@ -154,7 +154,7 @@ while ( (de=readdir(dir)) != NULL) } } -foo = closedir(dir); +closedir(dir); return nombre; }