Commits

Armin Ronacher  committed 91460a2

strndup is a linux extension not available on certain systems (like OS X)

  • Participants
  • Parent commits c793e11

Comments (0)

Files changed (1)

File src/common.c

         free(result->revision);
     if (len == -1)
         result->revision = strdup(revision);
-    else
-        result->revision = strndup(revision, len);
+    else {
+        result->revision = malloc(len);
+        if (!result->revision)
+            return 0;
+        strncpy(result->revision, revision, len);
+    }
     return !!result->revision;
 }