Remove sprintf from yaffs_guts because it isn't always available
authorcharles <charles>
Wed, 26 Nov 2008 20:42:04 +0000 (20:42 +0000)
committercharles <charles>
Wed, 26 Nov 2008 20:42:04 +0000 (20:42 +0000)
direct/ydirectenv.h
yaffs_guts.c
yportenv.h

index cae8880..78169b4 100644 (file)
@@ -37,6 +37,7 @@
 #define YCHAR char
 #define YUCHAR unsigned char
 #define _Y(x) x
+#define yaffs_strcat(a,b)    strcat(a,b)
 #define yaffs_strcpy(a,b)    strcpy(a,b)
 #define yaffs_strncpy(a,b,c) strncpy(a,b,c)
 #define yaffs_strncmp(a,b,c) strncmp(a,b,c)
index 6d19965..c74e25e 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 const char *yaffs_guts_c_version =
-    "$Id: yaffs_guts.c,v 1.64 2008-11-25 00:29:32 charles Exp $";
+    "$Id: yaffs_guts.c,v 1.65 2008-11-26 20:42:04 charles Exp $";
 
 #include "yportenv.h"
 
@@ -3148,7 +3148,7 @@ static int yaffs_GarbageCollectBlock(yaffs_Device * dev, int block)
                                                yaffs_ObjectHeader *oh;
                                                oh = (yaffs_ObjectHeader *)buffer;
                                                oh->isShrink = 0;
-                                               oh->shadowsObject = oh->inbandShadowsObject = -1;
+/*                                             oh->shadowsObject = oh->inbandShadowsObject = -1; */
                                                tags.extraShadows = 0;
                                                tags.extraIsShrinkHeader = 0;
                                                
@@ -6943,9 +6943,18 @@ int yaffs_GetObjectName(yaffs_Object * obj, YCHAR * name, int buffSize)
                yaffs_strncpy(name, YAFFS_LOSTNFOUND_NAME, buffSize - 1);
        } else if (obj->hdrChunk <= 0) {
                YCHAR locName[20];
+               YCHAR numString[20];
+               YCHAR *x = &numString[19];
+               unsigned v = obj->objectId;
+               numString[19] = 0;
+               while(v>0){
+                       x--;
+                       *x = '0' + (v % 10);
+                       v /= 10;
+               }
                /* make up a name */
-               yaffs_sprintf(locName, _Y("%s%d"), YAFFS_LOSTNFOUND_PREFIX,
-                             obj->objectId);
+               yaffs_strcpy(locName, YAFFS_LOSTNFOUND_PREFIX);
+               yaffs_strcat(locName,x);
                yaffs_strncpy(name, locName, buffSize - 1);
 
        }
index 097b2a6..bfda36e 100644 (file)
@@ -51,6 +51,7 @@
 #define YCHAR char
 #define YUCHAR unsigned char
 #define _Y(x)     x
+#define yaffs_strcat(a,b)    strcat(a,b)
 #define yaffs_strcpy(a,b)    strcpy(a,b)
 #define yaffs_strncpy(a,b,c) strncpy(a,b,c)
 #define yaffs_strncmp(a,b,c) strncmp(a,b,c)
 #define YCHAR char
 #define YUCHAR unsigned char
 #define _Y(x)     x
+#define yaffs_strcat(a,b)    strcat(a,b)
 #define yaffs_strcpy(a,b)    strcpy(a,b)
 #define yaffs_strncpy(a,b,c) strncpy(a,b,c)
 #define yaffs_strlen(s)             strlen(s)