+ key = envp[i];
+ keylen = strlen(key);
+
+ /* prevent loops in the scripts we execute */
+ if (strncmp(key, "UDEVD_EVENT=", 12) == 0) {
+ dbg("seems that the event source is not the kernel, just exit");
+ goto exit;
+ }
+
+ if (bufpos + keylen >= HOTPLUG_BUFFER_SIZE-1) {
+ dbg("environment buffer too small, probably not called by the kernel");
+ continue;
+ }
+
+ /* remember the SUBSYSTEM */
+ if (strncmp(key, "SUBSYSTEM=", 10) == 0)
+ subsystem = &key[10];
+
+ dbg("add '%s' to env[%i] buffer", key, i);
+ strcpy(&usend_msg.envbuf[bufpos], key);
+ bufpos += keylen + 1;