Commit graph

2 commits

Author SHA1 Message Date
Jon Loeliger
879e4d2590 Implement and use an xstrdup() function
Many places in dtc use strdup(), but none of them actually check the
return value to see if the implied allocation succeeded.  This is a
potential bug, which we fix in the patch below by replacing strdup()
with an xstrdup() which in analogy to xmalloc() will quit with a fatal
error if the allocation fails.

I felt the introduciton of util.[ch] was a better choice
for utility oriented code than directly using srcpos.c
for the new string function.

This patch is a re-factoring of Dave Gibson's similar patch.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
2008-10-03 11:12:33 -05:00
Jon Loeliger
68f98d7b8a Rearrange ftdump and convert-dtsv0 into sub-Makefiles.
Follows the model of the existing sub-Makefiles for dtc.

Adjust $(BIN) definition to represent installable bin programs
and use it as the list of installed programs rather than using
an enumerated list in the install target.

Adjust the tests/Makefile to clean up properly still.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
2008-10-03 10:50:28 -05:00