Commit 00625f4
committed
lib/utmp.c: get_current_utmp(): Use the stack for temporary copies
As Evgeny reported, malloc(3) is overkill here. He suggested using
other methods, which are less than ideal, but it's true that it's
overkill, and with the stack we can get something readable and more
efficient.
Reported-by: Evgeny Grin (Karlson2k) <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>1 parent cd4c864 commit 00625f4
1 file changed
+5
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
161 | 162 | | |
162 | | - | |
163 | | - | |
164 | 163 | | |
165 | 164 | | |
166 | 165 | | |
| |||
175 | 174 | | |
176 | 175 | | |
177 | 176 | | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | | - | |
| 183 | + | |
185 | 184 | | |
186 | 185 | | |
187 | 186 | | |
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
191 | 190 | | |
192 | | - | |
193 | | - | |
| 191 | + | |
194 | 192 | | |
195 | 193 | | |
196 | 194 | | |
197 | 195 | | |
198 | | - | |
199 | | - | |
| 196 | + | |
200 | 197 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | 198 | | |
207 | 199 | | |
208 | 200 | | |
| |||
0 commit comments