View | Details | Raw Unified | Return to bug 25147
Collapse All | Expand All

(-)pccardd/util.c (-13 / +31 lines)
Lines 237-244 Link Here
237
			/* copy over preceding string. */
237
			/* copy over preceding string. */
238
			while (lp != p)
238
			while (lp != p)
239
				*cp++ = *lp++;
239
				*cp++ = *lp++;
240
			/* stringify ethernet address and place here. */
241
			if (strncmp(p, "$ether", 6) == 0) {
240
			if (strncmp(p, "$ether", 6) == 0) {
241
			/* stringify ethernet address and place here. */
242
				sprintf(cp, "%x:%x:%x:%x:%x:%x",
242
				sprintf(cp, "%x:%x:%x:%x:%x:%x",
243
				    sp->eaddr[0],
243
				    sp->eaddr[0],
244
				    sp->eaddr[1],
244
				    sp->eaddr[1],
Lines 249-266 Link Here
249
				while (*++cp)
249
				while (*++cp)
250
					continue;
250
					continue;
251
				lp += 6;
251
				lp += 6;
252
			} else
252
			} else if (strncmp(p, "$device", 7) == 0) {
253
				/* replace device name */
253
			/* replace device name */
254
				if (strncmp(p, "$device", 7) == 0) {
254
				sprintf(cp, "%s%d",
255
					sprintf(cp, "%s%d",
255
				    sp->config->driver->kernel,
256
					    sp->config->driver->kernel,
256
				    sp->config->driver->unit);
257
					    sp->config->driver->unit);
257
				while (*cp)
258
					while (*cp)
258
					cp++;
259
						cp++;
259
				lp += 7;
260
					lp += 7;
260
			} else if (strncmp(p, "$ioaddr", 7) == 0) {
261
				} else
261
			/* replace i/o address */
262
					/* Copy the `$' and rescan. */
262
				sprintf(cp, "0x%X", sp->io.addr);
263
					*cp++ = *lp++;
263
				while (*cp)
264
					cp++;
265
				lp += 7;
266
			} else if (strncmp(p, "$iosize", 7) == 0) {
267
			/* replace i/o window size */
268
				sprintf(cp, "0x%X", sp->io.size);
269
				while (*cp)
270
					cp++;
271
				lp += 7;
272
			} else if (strncmp(p, "$irqnum", 7) == 0) {
273
			/* replace irq number */
274
				sprintf(cp, "%d", sp->irq);
275
				while (*cp)
276
					cp++;
277
				lp += 7;
278
			} else {
279
			/* Copy the `$' and rescan. */
280
				*cp++ = *lp++;
281
			}
264
		}
282
		}
265
		/* No more replacements. Copy rest of string. */
283
		/* No more replacements. Copy rest of string. */
266
		while ((*cp++ = *lp++) != 0)
284
		while ((*cp++ = *lp++) != 0)

Return to bug 25147