|
From: <gi...@gp...> - 2010-12-10 02:27:16
|
The branch, master has been updated
via 48ba0051476ab1e0bf1e8f3d598c410a09f41614 (commit)
from 317d46af556d23315078a8a466f0829e8032e123 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/create.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
=================
Commit Messages
=================
commit 48ba0051476ab1e0bf1e8f3d598c410a09f41614
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Ensure CreateNewText() returns NULL if called with NULL text.
Ensuring that text will not be NULL allows us to replace the
MyStrdup call with a simple strdup.
:100644 100644 bf3b688... 15c0099... M src/create.c
=========
Changes
=========
commit 48ba0051476ab1e0bf1e8f3d598c410a09f41614
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Ensure CreateNewText() returns NULL if called with NULL text.
Ensuring that text will not be NULL allows us to replace the
MyStrdup call with a simple strdup.
diff --git a/src/create.c b/src/create.c
index bf3b688..15c0099 100644
--- a/src/create.c
+++ b/src/create.c
@@ -578,9 +578,14 @@ CreateNewText (LayerTypePtr Layer, FontTypePtr PCBFont,
LocationType X, LocationType Y,
BYTE Direction, int Scale, char *TextString, FlagType Flags)
{
- TextTypePtr text = GetTextMemory (Layer);
- if (!text)
- return (text);
+ TextType *text;
+
+ if (TextString == NULL)
+ return NULL;
+
+ text = GetTextMemory (Layer);
+ if (text == NULL)
+ return NULL;
/* copy values, width and height are set by drawing routine
* because at this point we don't know which symbols are available
@@ -590,7 +595,7 @@ CreateNewText (LayerTypePtr Layer, FontTypePtr PCBFont,
text->Direction = Direction;
text->Flags = Flags;
text->Scale = Scale;
- text->TextString = MyStrdup (TextString, "CreateNewText()");
+ text->TextString = strdup (TextString);
/* calculate size of the bounding box */
SetTextBoundingBox (PCBFont, text);
|