]> git.lizzy.rs Git - minetest.git/blobdiff - src/util/pointer.h
Make minor style change(unescape_string())
[minetest.git] / src / util / pointer.h
index 775f0a3362de5fe0ae853ca3e5e53f2e049b4f15..7922a9b395734bc074e3a911e5f4cd06dde655fb 100644 (file)
@@ -1,6 +1,6 @@
 /*
-Minetest-c55
-Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
@@ -197,6 +197,7 @@ class SharedBuffer
                else
                        data = NULL;
                refcount = new unsigned int;
+               memset(data,0,sizeof(T)*m_size);
                (*refcount) = 1;
        }
        SharedBuffer(const SharedBuffer &buffer)
@@ -257,7 +258,7 @@ class SharedBuffer
        }
        T & operator[](unsigned int i) const
        {
-               //assert(i < m_size)
+               assert(i < m_size);
                return data[i];
        }
        T * operator*() const