* Shortened all strndup() buffers by one to have the same outcome as with
the previous local strndup() implementation. * Automatic whitespace cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28950 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
/* ParameterWeb - implements the following classes:
|
||||
** BParameterWeb, BParameterGroup, BParameter, BNullParameter,
|
||||
** BContinuousParameter, BDiscreteParameter
|
||||
**
|
||||
** Author: Zousar Shaker
|
||||
** Axel Dörfler, [email protected]
|
||||
** Marcus Overhagen
|
||||
**
|
||||
** This file may be used under the terms of the OpenBeOS License.
|
||||
*/
|
||||
/*
|
||||
* Copyright 2002-2009, Haiku. All Rights Reserved.
|
||||
* This file may be used under the terms of the MIT License.
|
||||
*
|
||||
* Author: Zousar Shaker
|
||||
* Axel Dörfler, [email protected]
|
||||
* Marcus Overhagen
|
||||
*/
|
||||
|
||||
/*! Implements the following classes:
|
||||
BParameterWeb, BParameterGroup, BParameter, BNullParameter,
|
||||
BContinuousParameter, BDiscreteParameter
|
||||
*/
|
||||
|
||||
#include <ParameterWeb.h>
|
||||
#include <MediaNode.h>
|
||||
@@ -679,7 +681,7 @@ BParameterGroup::BParameterGroup(BParameterWeb *web, const char *name)
|
||||
CALLED();
|
||||
TRACE("BParameterGroup: web = %p, name = \"%s\"\n", web, name);
|
||||
|
||||
mName = strndup(name, 256);
|
||||
mName = strndup(name, 255);
|
||||
|
||||
mControls = new BList();
|
||||
mGroups = new BList();
|
||||
@@ -1776,9 +1778,9 @@ BParameter::BParameter(int32 id, media_type mediaType, media_parameter_type type
|
||||
{
|
||||
CALLED();
|
||||
|
||||
mName = strndup(name, 256);
|
||||
mKind = strndup(kind, 256);
|
||||
mUnit = strndup(unit, 256);
|
||||
mName = strndup(name, 255);
|
||||
mKind = strndup(kind, 255);
|
||||
mUnit = strndup(unit, 255);
|
||||
|
||||
// create empty input/output lists
|
||||
mInputs = new BList();
|
||||
@@ -2093,7 +2095,7 @@ BDiscreteParameter::AddItem(int32 value, const char *name)
|
||||
ASSERT(mSelections != NULL);
|
||||
|
||||
int32 *valueCopy = new int32(value);
|
||||
char *nameCopy = strndup(name, 256);
|
||||
char *nameCopy = strndup(name, 255);
|
||||
if (name != NULL && nameCopy == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user