* 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,
|
* Copyright 2002-2009, Haiku. All Rights Reserved.
|
||||||
** BContinuousParameter, BDiscreteParameter
|
* This file may be used under the terms of the MIT License.
|
||||||
**
|
*
|
||||||
** Author: Zousar Shaker
|
* Author: Zousar Shaker
|
||||||
** Axel Dörfler, [email protected]
|
* Axel Dörfler, [email protected]
|
||||||
** Marcus Overhagen
|
* Marcus Overhagen
|
||||||
**
|
*/
|
||||||
** This file may be used under the terms of the OpenBeOS License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*! Implements the following classes:
|
||||||
|
BParameterWeb, BParameterGroup, BParameter, BNullParameter,
|
||||||
|
BContinuousParameter, BDiscreteParameter
|
||||||
|
*/
|
||||||
|
|
||||||
#include <ParameterWeb.h>
|
#include <ParameterWeb.h>
|
||||||
#include <MediaNode.h>
|
#include <MediaNode.h>
|
||||||
@@ -679,7 +681,7 @@ BParameterGroup::BParameterGroup(BParameterWeb *web, const char *name)
|
|||||||
CALLED();
|
CALLED();
|
||||||
TRACE("BParameterGroup: web = %p, name = \"%s\"\n", web, name);
|
TRACE("BParameterGroup: web = %p, name = \"%s\"\n", web, name);
|
||||||
|
|
||||||
mName = strndup(name, 256);
|
mName = strndup(name, 255);
|
||||||
|
|
||||||
mControls = new BList();
|
mControls = new BList();
|
||||||
mGroups = new BList();
|
mGroups = new BList();
|
||||||
@@ -1776,9 +1778,9 @@ BParameter::BParameter(int32 id, media_type mediaType, media_parameter_type type
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
mName = strndup(name, 256);
|
mName = strndup(name, 255);
|
||||||
mKind = strndup(kind, 256);
|
mKind = strndup(kind, 255);
|
||||||
mUnit = strndup(unit, 256);
|
mUnit = strndup(unit, 255);
|
||||||
|
|
||||||
// create empty input/output lists
|
// create empty input/output lists
|
||||||
mInputs = new BList();
|
mInputs = new BList();
|
||||||
@@ -2093,7 +2095,7 @@ BDiscreteParameter::AddItem(int32 value, const char *name)
|
|||||||
ASSERT(mSelections != NULL);
|
ASSERT(mSelections != NULL);
|
||||||
|
|
||||||
int32 *valueCopy = new int32(value);
|
int32 *valueCopy = new int32(value);
|
||||||
char *nameCopy = strndup(name, 256);
|
char *nameCopy = strndup(name, 255);
|
||||||
if (name != NULL && nameCopy == NULL)
|
if (name != NULL && nameCopy == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user