all repos — tint2 @ ed3fcd63fc7fb1c4061fbabc5fbd66eb2f3c2ed3

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Tint2conf: use strcat instead of append (issue #580)
o9000 mrovi9000@gmail.com
commit

ed3fcd63fc7fb1c4061fbabc5fbd66eb2f3c2ed3

parent

d49dac2e052b4a4fea99fb5ef6a29f4ffb531a90

3 files changed, 6 insertions(+), 19 deletions(-)

jump to
M src/tint2conf/properties_rw.csrc/tint2conf/properties_rw.c

@@ -158,15 +158,16 @@ fprintf(fp, "# Background %d: %s\n", index, text ? text : "");

fprintf(fp, "rounded = %d\n", r); fprintf(fp, "border_width = %d\n", b); - char *sides = "\0"; + char sides[10]; + sides[0] = '\0'; if (sideTop) - sides = append(sides, 'T'); + strcat(sides, "T"); if (sideBottom) - sides = append(sides, 'B'); + strcat(sides, "B"); if (sideLeft) - sides = append(sides, 'L'); + strcat(sides, "L"); if (sideRight) - sides = append(sides, 'R'); + strcat(sides, "R"); fprintf(fp, "border_sides = %s\n", sides); config_write_color(fp, "background_color", *fillColor, fillOpacity);
M src/util/common.csrc/util/common.c

@@ -44,17 +44,6 @@ #ifdef HAVE_RSVG

#include <librsvg/rsvg.h> #endif -char *append(char *s, char c) { - int len = strlen(s); - char buf[len+2]; - - strcpy(buf, s); - buf[len] = c; - buf[len + 1] = 0; - - return strdup(buf); -} - void copy_file(const char *path_src, const char *path_dest) { if (g_str_equal(path_src, path_dest))
M src/util/common.hsrc/util/common.h

@@ -41,9 +41,6 @@ } MouseAction;

#define ALL_DESKTOPS 0xFFFFFFFF -// add c to s -char *append(char *s, char c); - // Copies a file to another path void copy_file(const char *path_src, const char *path_dest);