Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 98419
Collapse All | Expand All

(-)getcwd.c.ORIG (-4 / +5 lines)
Lines 274-280 Link Here
274
	  char *new;
274
	  char *new;
275
	  if (dotlist == dots)
275
	  if (dotlist == dots)
276
	    {
276
	    {
277
	      new = malloc (dotsize * 2 + 1);
277
	      new = malloc (dotsize * 2 + 2);
278
	      if (new == NULL)
278
	      if (new == NULL)
279
		goto lose;
279
		goto lose;
280
#ifdef HAVE_MEMPCPY
280
#ifdef HAVE_MEMPCPY
Lines 286-302 Link Here
286
	    }
286
	    }
287
	  else
287
	  else
288
	    {
288
	    {
289
	      new = realloc ((__ptr_t) dotlist, dotsize * 2 + 1);
289
	      new = realloc ((__ptr_t) dotlist, dotsize * 2 + 2);
290
	      if (new == NULL)
290
	      if (new == NULL)
291
		goto lose;
291
		goto lose;
292
	      dotp = &new[dotsize];
292
	      dotp = &new[dotsize];
293
	    }
293
	    }
294
	    *dotp++ = '/';
294
#ifdef HAVE_MEMPCPY
295
#ifdef HAVE_MEMPCPY
295
	  *((char *) mempcpy ((char *) dotp, new, dotsize)) = '\0';
296
	  *((char *) mempcpy ((char *) dotp, new, dotsize)) = '\0';
296
	  dotsize *= 2;
297
	  dotsize = (dotsize * 2) + 1;
297
#else
298
#else
298
	  memcpy ((char *) dotp, new, dotsize);
299
	  memcpy ((char *) dotp, new, dotsize);
299
	  dotsize *= 2;
300
	  dotsize = (dotsize * 2) + 1;
300
	  new[dotsize] = '\0';
301
	  new[dotsize] = '\0';
301
#endif
302
#endif
302
	  dotlist = new;
303
	  dotlist = new;

Return to bug 98419