Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Add the KEY_END marker on key creation where missing #39

Merged
merged 1 commit into from
Aug 10, 2014

Conversation

pinotree
Copy link
Contributor

@pinotree pinotree commented Aug 7, 2014

Add the KEY_END vararg where missing when creating a new key, either
using the C keyNew or the C++ kdb::Key, as done everywhere else.

This fixes crashes in some tests.

@fberlakovich
Copy link
Contributor

Wow, great suggestions. Forgetting this caused errors for me numberless times

@@ -186,7 +186,7 @@ void test_constructor()
{
cout << "testing constructor" << endl;

ckdb::Key *ck = ckdb::keyNew(0);
ckdb::Key *ck = ckdb::keyNew(0, KEY_END);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look at src/libelektra/key.c 275 keyNew(0) should be perfectly valid, because without a name va_start is not executed. Did you have a crash on those lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, these changes were unneeded.

Add the KEY_END vararg where missing when creating a new key, either
using the C keyNew or the C++ kdb::Key, as done everywhere else.

This fixes crashes in some tests.
markus2330 pushed a commit that referenced this pull request Aug 10, 2014
Add the KEY_END marker on key creation where missing
@markus2330 markus2330 merged commit ac1ec60 into ElektraInitiative:master Aug 10, 2014
@pinotree pinotree deleted the va-args branch August 10, 2014 19:26
@markus2330 markus2330 mentioned this pull request Jul 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants