From c0dffb7c577b03ff63871b5d13be15f230a010a3 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Sat, 3 Oct 2015 22:52:46 +0300 Subject: use strings instead of char* --- libkms++/property.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libkms++/property.cpp') diff --git a/libkms++/property.cpp b/libkms++/property.cpp index af6a0ae..e01bf60 100644 --- a/libkms++/property.cpp +++ b/libkms++/property.cpp @@ -3,6 +3,8 @@ #include "kms++.h" +using namespace std; + namespace kms { @@ -16,6 +18,7 @@ Property::Property(Card& card, uint32_t id) { m_priv = new PropertyPriv(); m_priv->drm_prop = drmModeGetProperty(card.fd(), id); + m_name = m_priv->drm_prop->name; } Property::~Property() @@ -26,11 +29,11 @@ Property::~Property() void Property::print_short() const { - printf("Property %d, %s\n", id(), name()); + printf("Property %d, %s\n", id(), name().c_str()); } -const char *Property::name() const +const string& Property::name() const { - return m_priv->drm_prop->name; + return m_name; } } -- cgit v1.2.3