summaryrefslogtreecommitdiffstats
path: root/runtime/loc2c-runtime.h
diff options
context:
space:
mode:
authorroland <roland>2005-08-25 22:38:05 +0000
committerroland <roland>2005-08-25 22:38:05 +0000
commit65634add379c5afde33fbc7ea3201d24543dd666 (patch)
treea54ec50c1fb9d61b143078d7bd06432bb41a2b04 /runtime/loc2c-runtime.h
parent99af4508c80305f73698becdf23dca0b6a6fde86 (diff)
downloadsystemtap-steved-65634add379c5afde33fbc7ea3201d24543dd666.tar.gz
systemtap-steved-65634add379c5afde33fbc7ea3201d24543dd666.tar.xz
systemtap-steved-65634add379c5afde33fbc7ea3201d24543dd666.zip
2005-08-25 Roland McGrath <roland@redhat.com>
* loc2c-runtime.h (deref_string): Rewritten using deref.
Diffstat (limited to 'runtime/loc2c-runtime.h')
-rw-r--r--runtime/loc2c-runtime.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/loc2c-runtime.h b/runtime/loc2c-runtime.h
index 3b0289f3..91b5a0c5 100644
--- a/runtime/loc2c-runtime.h
+++ b/runtime/loc2c-runtime.h
@@ -174,7 +174,13 @@
#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); \
})