[pacman-dev] [PATCH] Strndup usage and small typo fix

Laszlo Papp djszapi2 at gmail.com
Wed Sep 16 15:22:11 EDT 2009


   ./src/pacman/package.c:
       - small typo fix
   ./src/pacman/pacman.c:
       - strdup is changed to strndup, because it's safer like in
       case of config option

Signed-off-by: Laszlo Papp <djszapi2 at gmail.com>
---
 src/pacman/package.c |    2 +-
 src/pacman/pacman.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pacman/package.c b/src/pacman/package.c
index 328d5bf..3b14516 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -84,7 +84,7 @@ void dump_pkg_full(pmpkg_t *pkg, int level)
 	}

 	if(level>0) {
-		/* compute this here so we don't get a puase in the middle of output */
+		/* compute this here so we don't get a pause in the middle of output */
 		requiredby = alpm_pkg_compute_requiredby(pkg);
 	}

diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 64598b0..5335c7d 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -454,7 +454,7 @@ static int parseargs(int argc, char *argv[])
 				config->flags |= PM_TRANS_FLAG_ALLDEPS;
 				break;
 			case 1009:
-				config->logfile = strdup(optarg);
+				config->logfile = strndup(optarg, PATH_MAX);
 				break;
 			case 1010:
 				list = strsplit(optarg, ',');
--
1.6.4.1



More information about the pacman-dev mailing list