From f556fe8b4a199116b5665bb5f0886e4c2962b077 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 28 May 2012 17:32:11 -0400 Subject: add line length parameter to _alpm_strip_newline If known, callers can pass the line size to this function in order to avoid an strlen call. Otherwise, they simply pass 0 and _alpm_strip_newline will do the call instead. Signed-off-by: Dave Reisner Signed-off-by: Dan McGee --- lib/libalpm/be_package.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/be_package.c') diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index 0d296a81..dd027f5e 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -168,7 +168,7 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t * /* loop until we reach EOF or other error */ while((ret = _alpm_archive_fgets(a, &buf)) == ARCHIVE_OK) { - size_t len = _alpm_strip_newline(buf.line); + size_t len = _alpm_strip_newline(buf.line, buf.real_line_size); linenum++; key = buf.line; -- cgit v1.2.3-24-g4f1b