Merge lp:~compiz-team/compiz/build-fixes-part-2 into lp:~compiz/compiz/ubuntu

Proposed by Sam Spilsbury on 2012-05-20
Status: Superseded
Proposed branch: lp:~compiz-team/compiz/build-fixes-part-2
Merge into: lp:~compiz/compiz/ubuntu
Prerequisite: lp:~compiz-team/compiz/build-fixes-part-1
Diff against target: 115 lines (+20/-11)
4 files modified
compizconfig/libcompizconfig/backend/src/ini.c (+16/-7)
compizconfig/libcompizconfig/src/config.c (+1/-1)
compizconfig/libcompizconfig/src/ini.c (+1/-1)
compizconfig/libcompizconfig/src/main.c (+2/-2)
To merge this branch: bzr merge lp:~compiz-team/compiz/build-fixes-part-2
Reviewer Review Type Date Requested Status
compiz packagers 2012-05-20 Pending
Review via email: mp+106514@code.launchpad.net

Description of the change

Testers should really test the last item in the branch pipeline lp:~compiz-team/compiz/build-fixes-part-10-animationaddon-plugin

This branch fixes some warnings in libcompizconfig. Always check the return value of asprintf.

To post a comment you must log in.

Unmerged revisions

3206. By Sam Spilsbury on 2012-05-19

Always check for -1

3205. By Sam Spilsbury on 2012-05-19

Check for -1

3204. By Sam Spilsbury on 2012-05-19

Fix asprintf warnings in ini backend

3203. By Sam Spilsbury on 2012-05-19

Merge first part of build fixes

3202. By Daniel van Vugt on 2012-05-18

Fix all compiler warnings and turn on -Werror again (treat warnings as errors)

3201. By Daniel van Vugt on 2012-05-17

Don't autmatically build compizconfig right now. It breaks cmake globally
and causes many different build failures, even in core components.

3200. By Sam Spilsbury on 2012-05-17

Don't depend on external compiz or libcompizconfig

3199. By Sam Spilsbury on 2012-05-17

Just have a separate pyclean for the python files

3198. By Sam Spilsbury on 2012-05-17

Fix some build cases

3197. By Sam Spilsbury on 2012-05-17

Make compizconfig build work

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'compizconfig/libcompizconfig/backend/src/ini.c'
2--- compizconfig/libcompizconfig/backend/src/ini.c 2012-05-20 10:45:42 +0000
3+++ compizconfig/libcompizconfig/backend/src/ini.c 2012-05-20 10:45:48 +0000
4@@ -82,15 +82,19 @@
5 configDir = getenv ("XDG_CONFIG_HOME");
6 if (configDir && strlen (configDir))
7 {
8- asprintf (&fileName, "%s/%s/%s.ini", configDir, SETTINGPATH, profile);
9+ if (asprintf (&fileName, "%s/%s/%s.ini", configDir, SETTINGPATH, profile) == -1)
10+ return NULL;
11+
12 return fileName;
13 }
14
15 configDir = getenv ("HOME");
16 if (configDir && strlen (configDir))
17 {
18- asprintf (&fileName, "%s/.config/%s/%s.ini", configDir, SETTINGPATH,
19- profile);
20+ if (asprintf (&fileName, "%s/.config/%s/%s.ini", configDir, SETTINGPATH,
21+ profile) == -1)
22+ return NULL;
23+
24 return fileName;
25 }
26
27@@ -265,7 +269,8 @@
28 if (!data)
29 return;
30
31- asprintf (&keyName, "s%d_%s", context->screenNum, setting->name);
32+ if (asprintf (&keyName, "s%d_%s", context->screenNum, setting->name) == -1)
33+ return;
34
35 switch (setting->type)
36 {
37@@ -455,7 +460,8 @@
38 if (!data)
39 return;
40
41- asprintf (&keyName, "s%d_%s", context->screenNum, setting->name);
42+ if (asprintf (&keyName, "s%d_%s", context->screenNum, setting->name) == -1)
43+ return;
44
45 if (setting->isDefault)
46 {
47@@ -656,7 +662,8 @@
48 configDir = getenv ("XDG_CONFIG_HOME");
49 if (configDir && strlen (configDir))
50 {
51- asprintf (&filePath, "%s/%s", configDir, SETTINGPATH);
52+ if (asprintf (&filePath, "%s/%s", configDir, SETTINGPATH) == -1)
53+ return NULL;
54
55 ret = scanConfigDir(filePath);
56 free(filePath);
57@@ -669,7 +676,9 @@
58 if (!homeDir)
59 return NULL;
60
61- asprintf (&filePath, "%s/.config/%s", homeDir, SETTINGPATH);
62+ if (asprintf (&filePath, "%s/.config/%s", homeDir, SETTINGPATH) == -1)
63+ filePath = NULL;
64+
65 if (!filePath)
66 return NULL;
67
68
69=== modified file 'compizconfig/libcompizconfig/src/config.c'
70--- compizconfig/libcompizconfig/src/config.c 2012-05-20 10:45:42 +0000
71+++ compizconfig/libcompizconfig/src/config.c 2012-05-20 10:45:48 +0000
72@@ -47,7 +47,7 @@
73 configDir = getenv ("HOME");
74 if (configDir && strlen (configDir))
75 {
76- if (asprintf (&fileName, "%s/.config/%s/config", configDir, SETTINGPATH))
77+ if (asprintf (&fileName, "%s/.config/%s/config", configDir, SETTINGPATH) == -1)
78 fileName = NULL;
79
80 return fileName;
81
82=== modified file 'compizconfig/libcompizconfig/src/ini.c'
83--- compizconfig/libcompizconfig/src/ini.c 2012-05-20 10:45:42 +0000
84+++ compizconfig/libcompizconfig/src/ini.c 2012-05-20 10:45:48 +0000
85@@ -625,7 +625,7 @@
86 {
87 char *string = NULL;
88
89- if (asprintf (&string, "%f", value))
90+ if (asprintf (&string, "%f", value) == -1)
91 string = NULL;
92
93 if (string)
94
95=== modified file 'compizconfig/libcompizconfig/src/main.c'
96--- compizconfig/libcompizconfig/src/main.c 2012-05-20 10:45:42 +0000
97+++ compizconfig/libcompizconfig/src/main.c 2012-05-20 10:45:48 +0000
98@@ -2699,7 +2699,7 @@
99
100 if (home && strlen (home))
101 {
102- if (asprintf (&backenddir, "%s/.compizconfig/backends", home))
103+ if (asprintf (&backenddir, "%s/.compizconfig/backends", home) == -1)
104 backenddir = NULL;
105
106 if (backenddir)
107@@ -2709,7 +2709,7 @@
108 }
109 }
110
111- if (asprintf (&backenddir, "%s/compizconfig/backends", LIBDIR))
112+ if (asprintf (&backenddir, "%s/compizconfig/backends", LIBDIR) == -1)
113 backenddir = NULL;
114
115 if (backenddir)

Subscribers

People subscribed via source and target branches