Skip site navigation (1)Skip section navigation (2)
Date:      Tue,  3 Feb 2009 23:37:11 +0100 (CET)
From:      Guido Falsi <mad@madpilot.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/131350: [maintainer-update] fix use of strndup in gnokii
Message-ID:  <20090203223711.F3E3E130C40@megatron.madpilot.net>
Resent-Message-ID: <200902032240.n13Me1AK065213@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         131350
>Category:       ports
>Synopsis:       [maintainer-update] fix use of strndup in gnokii
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 03 22:40:00 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Guido Falsi
>Release:        FreeBSD 7.1-STABLE i386
>Organization:
none
>Environment:
System: FreeBSD megatron.madpilot.net 7.1-STABLE FreeBSD 7.1-STABLE #14: Sat Jan 24 11:42:24 CET 2009 root@megatron.madpilot.net:/usr/obj/usr/src/sys/MEGATRON i386

>Description:

A function in gnokii happens to use strndup() which is implemented
only in 8.0, so revert it to a simple strdup().

added file:

files/patch-gnokii-gnokii.c

Reported by: ledondo2000 at gmail.com

>How-To-Repeat:

trying to compile gnokii with readline support.

>Fix:

diff -ruN gnokii.old/files/patch-gnokii-gnokii.c gnokii/files/patch-gnokii-gnokii.c
--- gnokii.old/files/patch-gnokii-gnokii.c	1970-01-01 01:00:00.000000000 +0100
+++ gnokii/files/patch-gnokii-gnokii.c	2009-02-03 23:24:44.000000000 +0100
@@ -0,0 +1,11 @@
+--- gnokii/gnokii.c.orig	2009-02-03 23:23:35.000000000 +0100
++++ gnokii/gnokii.c	2009-02-03 23:24:01.000000000 +0100
+@@ -1082,7 +1082,7 @@
+ 			else
+ 				len = strlen(input);
+ 			if (len > 0)
+-				argv[argc++] = strndup(input, len);
++				argv[argc++] = strdup(input);
+ 			input = tmp;
+ 		} while (input);
+ 		argv[argc] = NULL;
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090203223711.F3E3E130C40>