From bceaaf6eacb0bf2f23cf42af5d9ee8332a08560f Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 4 Feb 2012 10:05:50 +0100 Subject: cppcheck tells us: scanf without field width limits can crash with huge input data. (gimpgrad) Some additional scanf modifications (bzr r10932) --- src/extension/internal/gimpgrad.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/gimpgrad.cpp b/src/extension/internal/gimpgrad.cpp index e92a4e17e..a9a31fe84 100644 --- a/src/extension/internal/gimpgrad.cpp +++ b/src/extension/internal/gimpgrad.cpp @@ -31,12 +31,11 @@ namespace Extension { namespace Internal { /** - \brief A function to allocated anything -- just an example here + \brief A function to allocate anything -- just an example here \param module Unused \return Whether the load was sucessful */ -bool -GimpGrad::load (Inkscape::Extension::Extension */*module*/) +bool GimpGrad::load (Inkscape::Extension::Extension */*module*/) { // std::cout << "Hey, I'm loading!\n" << std::endl; return TRUE; @@ -47,15 +46,13 @@ GimpGrad::load (Inkscape::Extension::Extension */*module*/) \param module Unused \return None */ -void -GimpGrad::unload (Inkscape::Extension::Extension */*module*/) +void GimpGrad::unload (Inkscape::Extension::Extension */*module*/) { // std::cout << "Nooo! I'm being unloaded!" << std::endl; return; } -static void -append_css_num(Glib::ustring &str, double const num) +static void append_css_num(Glib::ustring &str, double const num) { CSSOStringStream stream; stream << num; @@ -74,8 +71,7 @@ append_css_num(Glib::ustring &str, double const num) hex values from 0 to 255 for color. Otherwise mostly this is just turning the values into strings and returning it. */ -static Glib::ustring -stop_svg(ColorRGBA const in_color, double const location) +static Glib::ustring stop_svg(ColorRGBA const in_color, double const location) { Glib::ustring ret("\n" -- cgit v1.2.3