]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/modify.c
ITS#4832 fix unint'd var
[openldap] / servers / slapd / modify.c
index ca53e0b9fa0e19284e31371351135341821a21f9..0cd1d039ab85b9bafd28040c07d578db28de7483 100644 (file)
@@ -924,11 +924,9 @@ void slap_mods_opattrs(
 
                ptr = ber_bvchr( &csn, '#' );
                if ( ptr ) {
-                       timestamp.bv_len = ptr - csn.bv_val;
-                       if ( timestamp.bv_len >= sizeof( timebuf ) ) {  /* ?!? */
-                               timestamp.bv_len = sizeof( timebuf ) - 1;
-                       }
+                       timestamp.bv_len = STRLENOF("YYYYMMDDHHMMSSZ");
                        AC_MEMCPY( timebuf, csn.bv_val, timestamp.bv_len );
+                       timebuf[timestamp.bv_len-1] = 'Z';
                        timebuf[timestamp.bv_len] = '\0';
 
                } else {