]> sourceware.org Git - systemtap.git/commitdiff
2005-08-25 Roland McGrath <roland@redhat.com>
authorroland <roland>
Thu, 25 Aug 2005 22:38:05 +0000 (22:38 +0000)
committerroland <roland>
Thu, 25 Aug 2005 22:38:05 +0000 (22:38 +0000)
* loc2c-runtime.h (deref_string): Rewritten using deref.

runtime/loc2c-runtime.h

index 3b0289f359de70ebfddd4e6eaa42fdf41afce8a9..91b5a0c5a88338e8e1fa59bb7d66c60f25e225e4 100644 (file)
 
 #define deref_string(dst, addr, maxbytes)                                    \
   ({                                                                         \
-    if (__strncpy_from_user ((dst), (const char __user *) (addr), (maxbytes)))\
-      goto deref_fault;                                                              \
+    uintptr_t _addr;                                                         \
+    size_t _len;                                                             \
+    unsigned char _c;                                                        \
+    char *_d = (dst);                                                        \
+    for (_len = (maxbytes), _addr = (addr);                                  \
+        _len > 1 && (_c = deref (1, _addr)) != '\0';                         \
+        --_len, ++_addr)                                                     \
+      *_d++ = _c;                                                            \
     (dst);                                                                   \
   })
This page took 0.027031 seconds and 5 git commands to generate.